Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My today's question is... is there any way to auto add an custom (whatever I want) Read more... each time I use the_excerpt or get_the_excerpt function???

Thanks in advance

share|improve this question

2 Answers 2

up vote 1 down vote accepted

From Twenty Ten's functions.php:

 /**
 * 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' );
share|improve this answer

I can't remember if I've modified the_excerpt() in my code somehow but I've just been using this in my loop

global $post;

the_excerpt();
echo '<a href="' . get_permalink($post->ID) . '" class="profile_postlink">Read more...</a>';
share|improve this answer
    
that is exactly what I'm using now, w/o results I want =( –  andresmijares25 Nov 23 '11 at 19:03
    
Can you post your code please? –  EddyR Nov 24 '11 at 6:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.