“Single post” combined with “Exclude Categories”
-
I’m trying to get my main page (based on the Kubrick theme) to display only a single post. However, I’m also trying to get the main page to never display my posts from the a certain category. I do this by using the code from the codex “The WordPress loop” example:
<?php if ( !(in_category(‘3’)) ) { ?>
However, when this code is combined with having a single post on the page, the post comes out blank.
Normally, with multiple posts on one page, the loop will get a bunch of posts and simply do nothing (skip) when a certain category is reached. However, with a single post on the page, the loop will simply do nothing, leaving an empty post with Previous and Next links.
Is there any way I can get a single post to display on my main page, while excluding a certain category at the same time?
- The topic ‘“Single post” combined with “Exclude Categories”’ is closed to new replies.