0

I have several category pages (e.g. example.com/?cat=3) that display only the post titles. I would like to make them display the post as well. What is the easiest way to do this?

0

Category pages or archives? If you're a little more specific you will probably get multiple ideas, but in general, if you've got a loop you can use one of the two following functions:

  • <?php the_excerpt(); ?> will show the custom or default excerpt for the post
  • <?php the_content('Read More &raquo;'); ?> will show the full post with a "Read More" link employed if you've used <!-- more--> in your post to show only part of the post on aggregate templates

If you are looking for simple functions for your templates to display content, you should probably read up on the WordPress codex.

  • I would like to display category pages. To add the_excerpt do I just make a filter for the loop? – Awesome Name Aug 3 '11 at 1:25
  • I'm not sure what you mean by category pages. Archives are generally date, category or tag based, so a category 'page' would be an archive in WP parlance. Or, do you mean something else? Normally, unless you only wanted to show title and meta data, an archive loop will include an excerpt or the post content. You wouldn't use a filter, you'd just place the function in the loop where you want the excerpt to show and surround it by the markup that you want to use to position/style it. – jameswanless Aug 3 '11 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.