• I have a site that covers 3 topics.. local, viral news, and product reviews. When people visit the site I want them to just see the local posts, but have the option of looking at the viral and product reviews posts by clicking on the nav. Is there a way to do this?

    Also is there a way to have 3 different rss feed addresses?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi jackstands,

    I just answered your question in the other forum where you asked it but I’ll answer it here as well for the benefit of others who may be wondering how to do it.

    You can approach this in 2 different ways using the query_posts() function. This is a powerful function and can be used for all sorts of things. You can:

    1. Include posts from ONE category to display on your home page or…

    2. Exclude posts from ALL categories except for the one you want to display on your home page. Either way achieves the same result. How you go about it I suppose depends on how many categories you actually have.

    Using method #1.
    Let’s assume you have 3 categories named Local, Viral and Product Reviews. At the very top of index.php insert the following…

    <?php
    if (is_home()) {
    query_posts("cat=x");
    }
    ?>

    …where x is the numerical ID of the category whose posts you want displayed. So, if you want to display posts only from the Local category on the home page then find the numerical ID of that category and insert it in the place of x.

    Using method #2.
    Again assuming you have the three categories as listed above insert the code below at the very top of index.php …

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

    This will EXCLUDE all posts from the categories you specify.

    Further reading on query_posts() and the various arguments that can be passed to it at,

    http://codex.wordpress.org/Template_Tags/query_posts

    Thread Starter jackstands

    (@jackstands)

    Hey Len, sorry about the multiple post, I figured if I worded it better I’d get a response. Thanks for your reply I’ll definitely try that!

    Thread Starter jackstands

    (@jackstands)

    That’s interesting.. how would I go about having different “home” pages for each of the three topics though? So far when I link to all the topics with a certain tag they come out as short summaries on an “all posts tagged viral” type page. Is there a way to have all three topics have a “home” page?

    Thanks again 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Making certain categories not appear on front page of blog?’ is closed to new replies.