1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress Code Help.. I Have No Idea What They Did $5 Paypal To Whoever Fixes This.

Discussion in 'Black Hat SEO' started by weruncompanies, Nov 23, 2012.

  1. weruncompanies

    weruncompanies Power Member

    Joined:
    Feb 15, 2011
    Messages:
    605
    Likes Received:
    286
    Location:
    California, USA
    Thanks all, fixed now.
     
    Last edited: Nov 23, 2012
  2. bobred

    bobred Registered Member

    Joined:
    Dec 21, 2011
    Messages:
    98
    Likes Received:
    63
    You can use a negative category value to exclude any given category_id from the loop, as follows

    Code:
    <?php if (!is_paged() and is_home()) {       query_posts('cat=-519');        wp_reset_query();
    ...which excludes posts from the category id 519 from showing
     
    • Thanks Thanks x 1
  3. WPRipper

    WPRipper Supreme Member

    Joined:
    Mar 24, 2010
    Messages:
    1,377
    Likes Received:
    1,493
    Location:
    Proudly romanian
    • Thanks Thanks x 1
  4. weruncompanies

    weruncompanies Power Member

    Joined:
    Feb 15, 2011
    Messages:
    605
    Likes Received:
    286
    Location:
    California, USA
    So where do I put this? And what about the $i=1 part?

    Yup, saw that and tried it as well, but it didn't work, broke my site and gave me an error so I had to reupload the backup functions.php. Add: Getting a parse error with that code..
     
    Last edited: Nov 23, 2012
  5. bobred

    bobred Registered Member

    Joined:
    Dec 21, 2011
    Messages:
    98
    Likes Received:
    63
    Well the $i=1 has nothing todo with any of the code you have posted, must be part of the theme or such... All you need to exclude cats is...

    Code:
    query_posts('cat=-519'); 
    ..replacing 519 with the correct ID, so easiest means would be to edit your themes index.php and look for the query_posts command and add
    Code:
    &cat=-519
    to it if it already contains a string, otherwise use
    Code:
    cat=-519
     
    • Thanks Thanks x 1
  6. weruncompanies

    weruncompanies Power Member

    Joined:
    Feb 15, 2011
    Messages:
    605
    Likes Received:
    286
    Location:
    California, USA
    Thanks! So.. This is the only place on the index.php file where the word "query_posts" shows:

    Now is this correct? All I have to do is replace that part so it looks like this:

    Does that look right? Orrr I think I'm close, not sure what to change exactly in that line of code or how to add it in. Thanks!
     
  7. weruncompanies

    weruncompanies Power Member

    Joined:
    Feb 15, 2011
    Messages:
    605
    Likes Received:
    286
    Location:
    California, USA
    Problem fixed, someone on another forum manually did it for me, sorry and thanks everyone!