How can i hide certain posts from an entire category from displaying on my main page ? i have no idea about coding i saw a few plugins but none were compatible with my version of wordpress
How can i hide certain posts from an entire category from displaying on my main page ? i have no idea about coding i saw a few plugins but none were compatible with my version of wordpress
On index.php of your theme, right after
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post();
?>
you add the following
<!-- If the post is in the category we want to exclude, we simply pass to the next post. -->
<?php if ($postnum == 1 ) { ?>
// My content
<?php } ?>
<?php if (in_category('3')) {$postnum = 0; continue; }
?>
where 3 is an example and you replace it with the appropriate category number.
that worked for one category but what if i want to exculde more than one categories ?
nevermind i worked it out thank you
thanks for the help.
I'm going to try it out too.
This topic has been closed to new replies.