Forums

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

  1. protist
    Member
    Posted 7 months 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 6 months ago #

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

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

Reply

You must log in to post.

About this Topic