最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to change the "Read more" text?

programmeradmin1浏览0评论

I am using this code in functions.php to so it will show on the front of my site and show the read more, but the read more is not showing, your help would be appreciated.

 function new_excerpt_more( $more ) {
    return ' <a href="'. get_permalink( get_the_ID() ) . ' '
           . __('<br/><br/> Read More') . '</a>';
    }

    add_filter( 'excerpt_more', 'new_excerpt_more');

Here is my site demo link:

I am using this code in functions.php to so it will show on the front of my site and show the read more, but the read more is not showing, your help would be appreciated.

 function new_excerpt_more( $more ) {
    return ' <a href="'. get_permalink( get_the_ID() ) . ' '
           . __('<br/><br/> Read More') . '</a>';
    }

    add_filter( 'excerpt_more', 'new_excerpt_more');

Here is my site demo link: http://visionedc/2015/news

Share Improve this question edited Oct 2, 2015 at 22:13 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Oct 2, 2015 at 21:20 Ray WilliamsRay Williams 11 gold badge1 silver badge2 bronze badges 1
  • You'll have great luck referencing the Codex, particularly the Customizing the Read More area. – Greg McMullen Commented Nov 7, 2016 at 2:21
Add a comment  | 

3 Answers 3

Reset to default 1

The excerpt_more filter only handles the linked text - not the link itself.

Try:

function new_excerpt_more( $more ) {
    return '<br/><br/>Read More';
}
add_filter( 'excerpt_more', 'new_excerpt_more');

I advises you to use this simple function in your functions.php

function read_more_modif(){
    $readmore = "make your custom text her" ;
    return '<div class="lireSuite"><a href="' . get_permalink() . '">"'.$readmore.'</a></div>'; 
    } 

add_filter( 'the_content_more_link', ' read_more_modif' );

Add this in functions.php:

function develop_custom_excerpt_more($more) {
     global $post;
     // edit here if you like
     return '...  <a class="excerpt-read-more" href="'. get_permalink( $post->ID ) . '" title="'. __( 'Read ', 'domain_name' ) . esc_attr( get_the_title( $post->ID ) ).'">'. __( 'Show more &raquo;', 'domain_name' ) .'</a>';
 }
 add_filter( 'excerpt_more', 'develop_custom_excerpt_more' );
发布评论

评论列表(0)

  1. 暂无评论