One category on homepage – cracked it!!
-
Ok, I’ve been puzzling on this for a few days, and i see many other people are asking how to do this. I think I have the answer (well, it’s working on my site).
So, you want your homepage circles to display posts from one category only?
Here’s how to do it.
First step – you need to know the category ID numbers. As they no longer show by default, you’ll need to install a plugin that reveals them. I’m using ‘Reveal IDs’.
Install and activate the plugin, then go to your Category page and you’ll see the IDs there. Get the number for the category you want to display, then open your index.php (Main Index Template) in Editor.
before
<?php /* Start the Loop */ ?>
add
<?php query_posts('cat=X'); ?>
changing X for the ID number of the category you want to display.
Save it, and check your homepage.
If you want to exclude one category from your homepage, it’s pretty much the same thing, but instead of
<?php query_posts('cat=X'); ?>
you add
<?php query_posts('cat=-X'); ?>
Change X for the ID number of the category you don’t want to show.
It’s worked for me, and it should work for everyone else. I literally figured this out 20 minutes ago, and as so many people have been asking how to do this I thought I’d better share ASAP!
*edit* proof – go to My site. I’ve excluded the ‘blog’ category from my homepage.
- The topic ‘One category on homepage – cracked it!!’ is closed to new replies.