Archived

This topic is now archived and is closed to further replies.

  • 0

Publish only in Categories?

Question

Posted · Report post

Hi, I have the Whitehouse Pro Theme and would like to know, if there is the possibility of publishing a post only in a specific category without the article appearing on the homepage. Is that possible? Or do you know a plugin? Best from Berlin, Germany Daniel

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post

In your _posts.php file add this code right before the loop, which look like this : `<?php if (have_posts()) : while (have_posts()) : the_post(); ?>` Code to add: ` <?php if ( is_home() ) { query_posts($query_string . '&cat=-3'); } ?> ` Replace the &cat=-3 with the category number you want to exclude. You find this out by clicking on the categories tab, then click on the actual category tag and see what ID comes up at the end of the URL

Share this post


Link to post
Share on other sites

Posted · Report post

Yes, that's possible. I'm not exactly sure how to do it (off-hand) I'm sure a quick google search will turn up answers.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for the answer. But NO, my quick google search does NOT turn up the answer. Maybe yours and you can do it for me?

Share this post


Link to post
Share on other sites