WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category archive (10 posts)

  1. mindfeck
    Member
    Posted 7 years ago #

    On my site, my posts with the category "writing" are displayed, but the whole post is displayed. Is there a way to only put the excerpt, or only the title?

  2. Jon Bourne
    Member
    Posted 7 years ago #

  3. mindfeck
    Member
    Posted 7 years ago #

    that has nothing to do with what I want.

  4. Jon Bourne
    Member
    Posted 7 years ago #

    It has everything to do with what you want. You are interested in the <!--more--> tag. This is what breaks the post so that only an excerpt is shown on the home page.

  5. mindfeck
    Member
    Posted 7 years ago #

    No, that does not work. I just want the title or the excerpt to show on this category archive page. That doesn't work. I've tried it.

  6. Chris_K
    Member
    Posted 7 years ago #

    Replacing the_content with the_excerpt works too.

    If you only want to do this for one category, you might have a look at Category_Templates as well.

  7. mindfeck
    Member
    Posted 7 years ago #

    That was my problem. I changed the_content to the_excerpt in my index page, and that changed it everywhere, but I wanted it as the_content on the front page. Is there an easy way to just list the titles of each post in a certain category?

  8. Chris_K
    Member
    Posted 7 years ago #

    Ok, I think I follow now. Your theme apparently uses index.php for many scenarios? this would be good to glance over then: Template_Hierarchy

    Here's what I'd try:
    Change your theme's index.php back to using the_content.
    Create an archive.php page as a copy of index.php, and change the_content to the_excerpt.

  9. mindfeck
    Member
    Posted 7 years ago #

    Thanks! That was exactly what I needed. If I just want the titles of the posts, what would I put?

  10. Chris_K
    Member
    Posted 7 years ago #

    Well, in that case you probably want to just completely remove the_content or the_excerpt (along with, presumably, whatever <div> tags wrap 'em in your theme)

Topic Closed

This topic has been closed to new replies.

About this Topic