Exclude certain categories from the frontpage
-
I need help excluding some posts in certain categories from the frontpage/homepage of my WordPress site.
I have tried using this code
<?php if (is_home()) { query_posts("cat=-45, -119"); } ?>
in the index.php of my theme right above the
<?php get_header(); ?>
It did block out the categories from appearing from my main page, and it kept it accessible from the sidebar. HOWEVER, it gave me an issue with navigation of older posts on the site; the part where u look at older posts with the “older posts” link. The issue was that if I went to any other page of my site, it showed the same list of posts on any of the pages, or “older posts” link I clicked. Whole issue is documented here.So what I am looking for is help with excluding the categories with some other code, or someone explaining what could be causing the issue.
- The topic ‘Exclude certain categories from the frontpage’ is closed to new replies.