WordPress.org

Support

Support » Plugins and Hacks » [Resolved] excluded categories?

[Resolved] excluded categories?

  • minushka

    @minushka

    I’ve been trying a number of plugins and coding to exclude one category from my frontpage, but nothing seems to work. Either nothing happens, or the entire site goes beserk. Anyone know something that actually does work?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Adam Brown

    @adamrbrown

    Have you played with query_posts?

    Something like this in your index.php would put a different set of posts on the front page as elsewhere:

    <?php
    if (is_home()){
      query_posts( ... put something here ... );
    }
    ?>
    Adam Brown

    @adamrbrown

    minushka

    @minushka

    adamrbrown, I’m not sure I understand what you want me to put there…

    And I tried that plugin. Nothing happened :S

    If you want to exclude some catagories in your home page then use the following code

    <?php
       if (is_home()) {
          query_posts("cat=-1,-2,-3");
       }
    ?>

    is_home = checks if it is your home page

    query_posts = searches the database for the given parametres. which is to exclude categories, 1,2,3

    Please go here and read the whole page for better love.

    minushka

    @minushka

    I read that section too, and tried, but it doesn’t say where in the index to put the code, I must have put it wrong because it messed up a whole lot 😛

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] excluded categories?’ is closed to new replies.
Skip to toolbar