Wordpress category question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyDogHasFleas
    Confirmed User
    • Apr 2008
    • 529

    #1

    Wordpress category question

    Is there a way to make a post show up only in the category page and not on the main page? For example I want to add some gay posts to my blog... but I only want them accessible from the gay category. Is this possible?
  • harvey
    Confirmed User
    • Jul 2001
    • 9266

    #2
    of course, just open your index page, look for the query and add

    Code:
    '&cat=-15'
    where 15 is your "gay" category.

    If you want to exclude it ONLY in main page but not in archives, do as follows:

    Code:
    <?php if ( is_home() ) 
    {
    query_posts($query_string . '&cat=-15, -20');
    }
    ?>
    where, again, 15 is your gay category and 20 is your tranny category, assuming you need to exclude more than 1 cat. Replace with your real category IDs, obviously
    This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55679

      #3
      or for the less wp friendly crowd theirs a nice plugin, i think advanced category exclude, which will work without touching any code.
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      Working...