Do you know the hardest part of wordpress themes (includes premium also) ? They don’t provide you a theme which displays your category page in post titles or in post excerpts. Category pages are for navigation purposes. It will be hard for the readers to check the full content. We should respect the reader’s time. Before trying this tutorial make sure you take a backup of the file you are going to work with.
If your WordPress theme is displaying full posts on the category pages you can find the tutorial for changing it, showing only the post excerpts or the post titles below.
Note : Most of the WordPress themes have those inside the archive.php or archives.php file.
1. Converting Your Category Page To Display Post Titles :
Displaying post titles is normally considered when you have a large number of posts on every category.
First open the mentioned file and find the post
loop. It normally looks like this :
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Now delete everything from that code to the end of the loop. It usually ends with this :
<?php endif; ?>
Replace the post loop code with the following different code loop for displaying only post titles :
<?php $temp_category = single_cat_title(”,false); if (!empty($temp_category)){ // give index ?>
<h1><?php single_cat_title(); ?></h1>
<p><?php echo(category_description(the_category_ID(false))); ?></p>
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<li><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a></li><br>
<?php endforeach; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
<?php endif; ?>
<?php }else{ // give details or single post ?>
…Here Code For Normal Post Overview
<?php } ?>
Thats all. Now save the file and check your new category page !
You can add tags like <li> or<ol> for ordering the posts with number or bullets and you can also style your page in your style sheet.
2. Converting Your Category Page To Display Post Excerpts :
The file is same here. The codes will be similar to this only.
<?php if (is_category()) { ?>
<h2 class=’archives’>Archive for ‘<?php echo single_cat_title(); ?>’ CATEGORY</h2>
<?php }
elseif (is_day()) { ?>
Check the loop in that file. It will be like this normally.
<?php while (have_posts()) : the_post(); ?>
After some lines of codes, you will find a argument that includes the full posts on category pages.
<?php the_content(__(‘Continue Reading…’));?>
For displaying the post excerpts, substitute the above line with the following line.
<?php the_excerpt() ?>
Note : If you don’t want to show the author, date or comments information then consider removing the meta data information from those pages. They are listed right after the post title.
Author Bio:
This Guest Post is written by S.Pradeep Kumar from HellBound Bloggers. Pradeep is a Technical Blogger. He blogs about all the technical and security related topics at his blog. You can contact him anytime through his Orkut Profile.





May 26th, 2009 at 12:13 am
Awesome! Funnily enough, I’ve needed to change my category pages so that they only show excerpts, so I’ll test this out on my blog later on! Thanks!
[Reply]
May 26th, 2009 at 5:23 am
Simon. If you have more number of posts in each category consider trying the “Display Titles” tutorial instead ! It destroys the navigation problems !
Cheers !
[Reply]
May 27th, 2009 at 11:36 am
Yup.. I like Showing Post Titles instead of Post Excerpts on Category Page. But still depends on the Category and your Post Titles.. (they should be self explanatory
)
[Reply]
May 26th, 2009 at 9:46 pm
Thanks for this tutorial… it is really useful.
[Reply]
May 27th, 2009 at 5:37 am
Glad it helped you !
[Reply]
May 26th, 2009 at 10:49 pm
You have gave very details tutorial here. keep it =)
[Reply]
May 27th, 2009 at 5:36 am
Cheers blinkky !
[Reply]
May 27th, 2009 at 11:36 am
Glad you liked, blinkky !
[Reply]
June 13th, 2009 at 7:03 am
Awesome post Pradeep, well done! I love styling my posts like this, and I think more people should do the same as well. You can get so much more content across this way.
.-= Alex | Asnio.com´s last blog ..Maximize Your Earnings Through the Thesis Affiliate Program =-.
[Reply]
June 13th, 2009 at 2:13 pm
Yup, I also love the way posts look.
Much more content on a single page. And Read friendly, and the page loads faster.
[Reply]
July 2nd, 2009 at 7:59 pm
Thanks Alex !
.-= S.Pradeep Kumar´s last blog ..Miles To Walk Before 2009 (Site Goals) =-.
[Reply]
July 2nd, 2009 at 3:23 pm
Trying to insert it inbetween my div=”content” tags, giving me a t_string error at line 27 or 29.
Here’s what categories.php looks like:
Any ideas? Frustrating!
.-= G´s last blog ..99 Excuses & Exercise Ain’t One – Excuse #1 =-.
[Reply]
July 2nd, 2009 at 3:24 pm
doh can’t paste the code … nonetheless, did exactly as instructed but not working right for me – any idea what I may be doing wrong? Just want a simple category page that lists post titles instead of entire post.
.-= G´s last blog ..99 Excuses & Exercise Ain’t One – Excuse #1 =-.
[Reply]
July 2nd, 2009 at 7:58 pm
Mr.G thanks for trying out our tutorial !
I think you tried to show the code here.. but it is not displaying.. that is ok.. can you send me your blog’s categories.php or archives.php file.. may I can tweak something there…
BTW, does your blog have archives.php file ? If so, you should try this thing there only … categories.php is the alternate choice for archives.php ..
Cheers !
.-= S.Pradeep Kumar´s last blog ..Miles To Walk Before 2009 (Site Goals) =-.
[Reply]
October 23rd, 2009 at 11:51 pm
nice tip, and this is my first visit to this blog. good going.
[Reply]
February 4th, 2010 at 4:59 pm
Great pots,
but how can i display my category list by alphabetic order.
[Reply]