Viewing 2 replies - 16 through 17 (of 17 total)
  • hi,

    I tried all the things mentioned above,but some how what ever changes i make in functions.php about the code:-

    function twentyten_continue_reading_link() {
    	return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>';
    }

    don’t show any changes.

    I tried replacing the above with the one i_banks said.i even tried changing ‘continue reading’.

    What should i do?

    Please help

    P.S:- I am using the

    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>

    in loop.php

    and i guess the above changes take place for excerpt.

    1. Create a child theme so that you don’t lose your changes when upgrading wordpress.

    2. Add the following code to change to your custom value. My situation called for a ‘more’ link. Put in whatever text/markup you want. This code first removes the excerpt ‘more’ filters from the Twenty Ten parent theme. Then it replicates the functions and makes a call to its own function where you can control the ‘more’ text/markup.

    Notes: To remove the more link altogether, just use the top 5 lines and leave out the duplicate functions/add_filters below. To increase the excerpt length, add your own excerpt_length function and filter and remove the twentyten_excerpt_length filter.

    add_action( 'after_setup_theme', 'mc_setup' );
    function mc_setup() {
    	remove_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
    	remove_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
    }
    
    function mc_auto_excerpt_more( $more ) {
    	return ' …' . mc_custom_more_link();
    }
    add_filter( 'excerpt_more', 'mc_auto_excerpt_more' );
    
    function mc_custom_excerpt_more( $output ) {
    	if ( has_excerpt() && ! is_attachment() ) {
    		$output .= mc_custom_more_link();
    	}
    	return $output;
    }
    add_filter( 'get_the_excerpt', 'mc_custom_excerpt_more' );
    
    function mc_custom_more_link(){
    	return '<div class="excerpt-more"><a href="'. get_permalink() . '">' . __( 'more') . '</a></div>';
    }
Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Getting Rid Of "Continue Reading" in the_excerpt()’ is closed to new replies.