• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
Daily Blog Tips

Daily Blog Tips

How to make money from your blog

  • Home
  • Popular
  • Contributors
  • About
  • Contact / Advertise
  • Blogging
  • Marketing
  • Design
  • Money
  • Reviews
  • Productivity
  • Software
  • Technology

How to make category pages display post excerpts

By Mark 25 Comments Reading Time: 2 minutes

Category pages, just like search results or archives, are usually used for navigation purposes. Considering this fact it would make no sense to display full posts on those pages since the reader needs to be able to skim through a larger number of posts to decide what he wants to read.

If your WordPress theme is currently displaying full posts on the category or archive pages below you will find how to change it, showing only the post excerpts or even the post titles.

First of all you need to locate the file inside your theme folder that is managing the category, archives and search pages. Most WordPress themes have that information inside the archive.php or archives.php file.

The file will look more or less like this:

<?php if (is_category()) { ?>
<h2 class='archives'>Archive for the '<?php echo single_cat_title(); ?>' Category</h2>
<?php }
elseif (is_day()) { ?>
<h2 class='archives'>Archive for <?php the_time('F jS, Y'); ?></h2>

Once you find the file you will need to find where the Loop starts, usually with the following line:

<?php while (have_posts()) : the_post(); ?>

The information contained inside the Loop will govern the structure of the posts inside the mentioned pages (categories, archives, search results and so on). A couple of lines after the beginning of the Loop you will find the argument that includes the full posts on those pages:

<?php the_content(__('Read more »'));?>

In order to display the post excerpts you will need to substitute that line with the following:

<?php the_excerpt() ?>

If you want to display only the post titles (should be considered if you have a large number of posts on every category or on the archives) you can just eliminate that line altogether.

Finally, you may also want to remove the meta data (author, date or comments information) from those pages, which should be listed right after the post title or after the content line.

Don’t have a blog yet? Click here to start yours in 4 easy steps!
How to make category pages display post excerpts Photo

About Mark

Mark is an digital entrepreneur from New York City who recently acquired DBT. He started his ventures buying growing then selling several businesses and content blogs on Flippa. A perfect night for him constitutes pizza, wine, slow jazz and WordPress! He's an SEO expert and a growth strategist. When he's not working on his businesses he enjoys sharing his learned lessons with the DBT community.

Reader Interactions

Comments

  1. Avatar of Keith DavisonKeith Davison says

    at

    Daniel
    Short, sweet and to the point… just what I needed.
    Great to see the code displayed with easy steps for the php phibic like me!

    Reply
  2. Avatar of DanielonDanielon says

    at

    Thanks for being the brains trust!

    Reply
  3. Avatar of CreativeUnitonCreativeUniton says

    at

    Thank you for posting this!!!

    Reply
  4. Avatar of Adam PieniazekonAdam Pieniazekon says

    at

    That code did not come through correct:

    Reply
  5. Avatar of Adam PieniazekonAdam Pieniazekon says

    at

    Nevermind, got it. Simply place the below code after the excerpt code:

    Reply
  6. Avatar of Adam PieniazekonAdam Pieniazekon says

    at

    Is there a way to include the read more link dave was talking about on excerpts without fuddling about with the tag?

    Reply
  7. Avatar of MasdinonMasdinon says

    at

    Thank you very much for sharing

    Reply
  8. Avatar of Bang KritikusonBang Kritikuson says

    at

    Thanks for your guides

    Reply
  9. Avatar of I V Y O L O G YonI V Y O L O G Yon says

    at

    Oh my god, THANK YOU!!! I was told I have to install a plugin and fiddle with this and that, but no! I don’t! Thank you SO much for the simple instructions, you rock.

    Reply
  10. Avatar of PeterVkonPeterVkon says

    at

    Thanks! Tip worked like a charm.

    Reply
  11. Avatar of daveondaveon says

    at

    oops forgot to list the plugin for whoever might be interested…
    http://guff.szub.net/2005/02/26/the_excerpt-reloaded/

    Reply
  12. Avatar of daveondaveon says

    at

    never mind…. i just found this really great plugin which does everything i want and more!

    Reply
  13. Avatar of daveondaveon says

    at

    Just a quick question….. how do you change the […] at the end of the excerpt to “read more” or “see more” or anything instead of […] ?
    dave

    Reply
  14. Avatar of liuxxironliuxxiron says

    at

    prevedburzhuy

    Reply
  15. Avatar of Andrew SwihartonAndrew Swiharton says

    at

    Glad I use Textpattern so I never have to deal with an issue like this where you actually have to know some php to do such a simple thing.

    Reply
  16. Avatar of DanielonDanielon says

    at

    Rich, at the very least I think your theme has on call for single posts and one for archives, categories and search results, could it be?

    Reply
  17. Avatar of RichonRichon says

    at

    Excellent info. I found myself in the same boat as Rory in that the theme I use (Burvy from GFX) did not have separate calls for archives and categories. I’m not an expert, but it seems my theme uses the same post output whether it is single post, archive, or category selected. I tried to carve out an excerpt call in the index.php just for category pages with the info you give but I couldn’t get it to work.

    Reply
  18. Avatar of AjayonAjayon says

    at

    Daniel, you should mention that a category.php in the theme is the best way to create the category pages. Alternatively, you can use the (is_category()) and if true display the_excerpt otherwise do the_content

    Reply
  19. Avatar of ThilakonThilakon says

    at

    Sweet Hack! I really hate to see long posts in archives. I use a plugin called Evenmore, which does this automatically

    Reply
  20. Avatar of engtechonengtechon says

    at

    Excerpts are a great practice. Here’s a good article on them:

    Reply
  21. Avatar of DanielonDanielon says

    at

    Rory, lets chat via Skype, the file must be there somewhere otherwise the category pages would not be loading hehe.

    Reply
  22. Avatar of RoryonRoryon says

    at

    I hit a roadblock straight away – I don’t have an archives.php!

    Reply
  23. Avatar of Madhur KapooronMadhur Kapooron says

    at

    Very nice tip Daniel .

    Reply
  24. Avatar of DanielonDanielon says

    at

    I voted for Problogger.net myself, so no big deal

    Reply
  25. Avatar of RoryonRoryon says

    at

    Brilliant. Thank you for this.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Trending Today

Popular

  • 28 Ways to Make Money with Your Website 514 Comments
  • 43 Web Design Mistakes You Should Avoid 474 Comments
  • 4 Steps to Increase Your Blog Traffic 188 Comments
  • How to Find Advertisers for Your Website 126 Comments
  • Top 25 SEO Blogs 243 Comments
  • 101 Blog Tips I learned 177 Comments
  • 30 Traffic Generation Tips 351 Comments
  • 6 Ways to Speed Up Your Site 51 Comments
  • 9 Hacks to Show Readers Your Best Stuff 21 Comments
  • 50 Simple Ways to Gain RSS Subscribers 145 Comments
  • The Best Website Taglines 127 Comments
  • What Is Success? 57 Comments
  • How to setup a 301 Redirect 52 Comments
  • The 7 Characteristics of Good Domains 76 Comments
  • 7 Ways to Promote your Site 133 Comments
  • Top 25 Celebrity Blogs 44 Comments
  • What Is A Blog? 81 Comments
  • Blog Setup: 40 Practical Tips 57 Comments
  • 10 Tips To Write Your Most Popular Post 79 Comments
  • The Blog Post Checklist 75 Comments
  • Interview: 12 Top Online Entrepreneurs 98 Comments
  • What Is Bounce Rate? 42 Comments
  • 20 SEO Terms You Should Know 28 Comments
  • How To Choose A Blog Name 15 Comments
  • 10 Tips to Sell Your Website on Flippa 37 Comments
  • Top 25 Web Design Blogs 80 Comments

Online business done right. Take your marketing efforts to the next level with tips and resources to get visitors to your website.
As featured
CNBC copyblogger problogger Entrepreneur Lifehacker Hubspot Business Insider Wordpress Showcase
Privacy Policy| Terms of Service | About | Contact

777 Brickell Ave #500-14648, Miami, FL, 33131, US
DBT Logo
DBT is an independent website. The views expressed on this site may come from individual contributors and do not necessarily reflect the view of DBT or any other organization. All Content Copyright ©2006-2023. Daily Blog Tips unless otherwise noted or credited.