WordPress.org

Ready to get started?Download WordPress

Forums

Modifying Excerpt Format (5 posts)

  1. jzader
    Member
    Posted 8 years ago #

    I am using an the excerpt tag inside The Loop, on a page outside of my WordPress blog. I need to modify my output in the following ways.

    (1) I would like to make the excerpts shorter, e.g., 100 words.

    (2) I would like to remove the <br /> tags that are not getting stripped out from the excerpts. (I wonder if this is because of my recent import from MoveableType. I get the impression that the tags should all be getting stripped out, but they weren't for the posts I imported.) I want a clean, short paragraph for each excerpt.

    And (3) I would like The Loop to list only the most recent 5 posts rather than the 10 that seem to be coming through by default. I'm assuming I have to modify the while statement somehow, but I can't find any examples of this.

    Any suggestions or links to more information would be greatly appreciated!

  2. moshu
    Member
    Posted 8 years ago #

    For #1 - you may want to try this plugin: http://guff.szub.net/the-excerpt-reloaded
    #2. If it's caused by MT import... I am clueless. Otherwise I am sure the plugin will help.
    #3. Did you try to set the number of posts displayed in the admin panel > Options > Reading?

  3. jzader
    Member
    Posted 8 years ago #

    #1 & #2 - Looks like the plugin will be helpful... I'll give it a shot. Thank you!

    #3 - Since this code is being used outside my blog folder, I'm sure that changing settings in the admin panel will affect what I don't want to affect (the main blog page) rather than what I want it to affect (the main page of my site).

    Any other way to control how many posts are shown on a page outside the blog itself?

  4. tomhanna
    Member
    Posted 8 years ago #

    I think you could use the query_posts template tag and set posts_per_page to whatever number you want.

  5. jzader
    Member
    Posted 8 years ago #

    tomhanna: Thank you, the query_posts template tag worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags