Show Every Post On Your Category Page
I am sure if you are interested in SEO you have come across Aaron Walls SEOBook.com. If you haven’t then you need to. It’s a great resource. One of the things that I noticed and liked about Aaron’s website is how it handles separate categories. For instance, take his Marketing category. When you load the page it shows every single post that falls under marketing with no pagenation at all. Me, personally, I hate pagination and try to avoid it where I can. I would want all of my marketing content to appear on the same page and not split into tens if not hundreds of pages. It removes any doubt in the search engine crawlers mind about what to index and where to place it. With just one page for all things marketing it will index only that one page, which as you can see with Aarons page is full of useful information on marketing. Also, when people link to your marketing page it doesn’t leak that link weight to each separate page. I also remove pagination from my blog main page too. If users want to browse further they simply click on the category to view more pages. This removes even more pages from my website that dilute link weight.
Now, after I saw this I wanted to replicate the exact behavior on Wordpress so I begin going through the code to see what I could do. I was able to successfully implement it and now you can too.
Here is how you can set up your blog to behave in the same manner:
In your template folder find index.php and category.php and remove:
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
In category.php find (Don’t have a category.php? Click Here):
<?php get_header(); ?>
and replace it with:
<?php get_header(); query_posts('posts_per_page=-1&cat=' . $cat) ?>
Now when you open up one of your categories you will see every post under that category. You can see it in action here: Mustang News.
You can customize your category.php page to help increase load time, for example, by removing the content and just having the titles show.






User Comments
Post Comment