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
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!
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 🙂