Jump to content
Sign in to follow this  
daniel-brueckner

Publish only in Categories?

Recommended Posts

daniel-brueckner    0
daniel-brueckner

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
Andrew    201
Andrew

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
daniel-brueckner    0
daniel-brueckner

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
cmunns    16
cmunns

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×