WordPress.org

Support

Support » Themes and Templates » [Resolved] Remove 'Read-More' Link

[Resolved] Remove 'Read-More' Link

  • Hi, could anyone tell me how to remove the read more link from my post excerpts?

    //EXCERPT
    function excerpt_length( $length ) {
    	return 10;
    }
    add_filter( 'excerpt_length', 'excerpt_length' );
    
    function continue_reading_link() {
    	return ' <a href="'. get_permalink() . '">' . __( 'Read more <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
    }
    
    function auto_excerpt_more( $more ) {
    	return ' &hellip;' . continue_reading_link();
    }
    add_filter( 'excerpt_more', 'auto_excerpt_more' );
    
    function custom_excerpt_more( $output ) {
    	if ( has_excerpt() && ! is_attachment() ) {
    		$output .= continue_reading_link();
    	}
    	return $output;
    }
    add_filter( 'get_the_excerpt', 'custom_excerpt_more' );
    //EXCERPT

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • It says ‘Read more’ right there in your code. Just replace it by a space.

    Chip Bennett

    @chipbennett

    Theme Review Admin

    If you want to remove the link entirely, replace this:

    function continue_reading_link() {
    	return ' <a href="'. get_permalink() . '">' . __( 'Read more <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
    }

    With this:

    function continue_reading_link() {
    	return '';
    }

    Thanks for the help, that worked perfectly!

    Hi,

    Im trying to do the exact same thing….

    Which file do I need to edit this in? I’ve had a look but can’t see it in functions or post-template php, or have I just missed it?

    Thanks so much in advance,

    hello,

    can anyone help me with this please and point me in the right direction?

    thankyou…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Remove 'Read-More' Link’ is closed to new replies.