• I’d like to replace the “Continue reading” link that’s in my category excerpts to the simple (and shorter) […]. Here is the section of code from my functions.php file that addresses that….

    /**
     * Returns a "Continue Reading" link for excerpts
     *
     * @since Twenty Ten 1.0
     * @return string "Continue Reading" link
     */
    function twentyten_continue_reading_link() {
    	return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
    }
    
    /**
     * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link().
     *
     * To override this in a child theme, remove the filter and add your own
     * function tied to the excerpt_more filter hook.
     *
     * @since Twenty Ten 1.0
     * @return string An ellipsis
     */
    function twentyten_auto_excerpt_more( $more ) {
    	return ' &hellip;' . twentyten_continue_reading_link();
    }
    add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
    
    /**
     * Adds a pretty "Continue Reading" link to custom post excerpts.
     *
     * To override this link in a child theme, remove the filter and add your own
     * function tied to the get_the_excerpt filter hook.
     *
     * @since Twenty Ten 1.0
     * @return string Excerpt with a pretty "Continue Reading" link
     */
    function twentyten_custom_excerpt_more( $output ) {
    	if ( has_excerpt() && ! is_attachment() ) {
    		$output .= twentyten_continue_reading_link();
    	}
    	return $output;
    }
    add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );

    I’m assuming I need to change something in here somewhere, but I’m unsure where or what. If anyone could give me a hand I’d appreciate it.

    Thanks ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dcloud

    (@dcloud)

    *bump*

    I am having the same problem. For such a simple issue it seems so difficult to fix.

    i woult like the !—more— tag to return the text “read more” rather than the default twentyten “continue reading”.

    Hello guys, try this:

    <?php
    function new_excerpt_more($more) {
    	return ' <a href="'. get_permalink() . '">' . __('<br/>' . '<br/>' . '[...] <span class="meta-nav"></span>', 'twentyten' ) . '</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    ?>

    Note this should not replace any previous code

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to replace "Continue reading" with […]’ is closed to new replies.