Forums

the_excert or the_content (2 posts)

  1. urbanpanda
    Member
    Posted 1 year ago #

    Hi, I'm making a theme for someone and on the front page I want to display the latest post in a box that is a certain size, meaning I can probably only show a bit of a post, unless it is very short. I ran into a dilemma though, I opted to use the excerpt with a custom length, but it seems to delete line breaks and p tags, making it a giant block of text. I don't want to use the <-- more --> method as I don't trust this guy to put them in every time or put them in the correct place if he does.

    So...is there a way to make the_excerpt display with formatting, or display only a short bit of the_content without a more tag?

    here's the code i'm using to display the post bit:

    function new_excerpt_length($length) {
    return 225;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    the_excerpt();

    p.s. search seems flooded with people trying to remove p tags from around the_excerpt.
    p.p.s. this is my first time making a wordpress theme, sorry if it's something simple.

  2. urbanpanda
    Member
    Posted 1 year ago #

    Figured it out, found this plugin:
    http://www.webspaceworks.com/resources/wordpress/44/

    it's pretty nifty, did everything I needed.

Topic Closed

This topic has been closed to new replies.

About this Topic