Forums

"Read more" for the_excerpt() (2 posts)

  1. protist
    Member
    Posted 2 years ago #

    I'm trying to port an existing blog from Textpattern to WordPress. In Textpattern, I was able to say, if there's an excerpt use the excerpt and show a "read more" link at the end. Otherwise, show the content field. In WordPress, I get most of the way there with this:

    <?php
    if($post->post_excerpt){
      the_excerpt();
    } else {
      the_content('read more');
    }
    ?>

    This allows me to choose between using the excerpt and the 'more' tag in the content field. The problem is that I can't figure out how to add a "read more" link to the excerpt since it doesn't allow parameters. FYI: I can read and understand PHP, but can't write much myself, yet. Does anyone have any ideas?

  2. Desertfrog
    Member
    Posted 2 years ago #

    You could try using "the_excerpt_reloaded". It's a plugin that allows parameters.

    guff.szub.net/2005/02/26/the_excerpt-reloaded

Topic Closed

This topic has been closed to new replies.

About this Topic