WordPress.org

Ready to get started?Download WordPress

Forums

Excerpts - No 'read more' link (6 posts)

  1. mtepaa
    Member
    Posted 5 years ago #

    Hi, I am using the excerpts feature. And I cannot see any (read more) link at the end of my excerpts on any page. I read that the default text was '...' but I cannot even see that. I also tried the plugni 'excerpt editor' but still no link showing..

    thanks in advance, your help is much appreciated

  2. stvwlf
    Member
    Posted 5 years ago #

    Are you using custom excerpts, or the built-in "the_excerpts()"? custom excerpts don't include the ellipse.

    here is some code you may find useful to customize excerpts. If you decide to use one of these the code gets placed in your theme's functions.php file.

    Replace Excerpt [...] ellipse with user-defined text (put in functions.php)

    function excerpt_ellipse($text) {
       return str_replace('[...]', ' <a href="'.get_permalink().'">Read more...</a>', $text); }
    add_filter('the_excerpt', 'excerpt_ellipse');

    If, however, you are writing your own excerpts and want to add a Read More permalink, replace:

    <?php the_excerpt(); ?>
    with this:
    <?php the_excerpt(); ?><span class="read_more"><a href="<?php the_permalink(); ?>">[ Read More &rarr; ]</a></span>

  3. hibbers
    Member
    Posted 5 years ago #

    just what I was looking for, thanks!

  4. gregalam
    Member
    Posted 4 years ago #

    The code to be pasted into the functions.php file should have
    <?php
    before it and
    ?>
    after it like this.

    <?php function excerpt_ellipse($text) {
       return str_replace('[...]', ' <a href="'.get_permalink().'">Read more...</a>', $text); }
    add_filter('the_excerpt', 'excerpt_ellipse');
    ?>
  5. langhorn
    Member
    Posted 4 years ago #

    thanks!

  6. dcfitzg
    Member
    Posted 4 years ago #

    I tried using <?php the_excerpt(); ?><span class="read_more">">[ Read More → ]</span> for a single post but the problem is that the link loops back to the excerpt and does not ever show the full post. Is it not possible to show summaries or excerpts of content on a single post?

    The site I'm attempting to do this with is: http://www.devonfitzgerald.com/hyperlocal

Topic Closed

This topic has been closed to new replies.

About this Topic