WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove 'Read-More' Link (6 posts)

  1. The Night Fox
    Member
    Posted 3 years ago #

    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.

  2. Roy
    Member
    Posted 3 years ago #

    It says 'Read more' right there in your code. Just replace it by a space.

  3. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    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 '';
    }
  4. The Night Fox
    Member
    Posted 3 years ago #

    Thanks for the help, that worked perfectly!

  5. roxette cassette
    Member
    Posted 2 years ago #

    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,

  6. roxette cassette
    Member
    Posted 2 years ago #

    hello,

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

    thankyou...

Topic Closed

This topic has been closed to new replies.

About this Topic