WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the excerpt field (Not the tag, because the excerpt also serves as a lead paragraph). I altered the "more"-link to be an arrow >.

function fabs_excerpt_more( $more ) {
    return ' <a class="more" href="'. get_permalink( get_the_ID() ) . '">></a>';
add_filter( 'excerpt_more', 'fabs_excerpt_more' );

But it only appears, if the excerpt is trimmed down. I also tried this:

function fabs_excerpt_more($output) {
 global $post;
 return $output . '<a class="more" href="'. get_permalink($post->ID) . '">></a>';
add_filter( 'the_excerpt', 'fabs_excerpt_more' );

In that case the > appears for every excerpt, but after the closing p-tag. Is there a way to let it appear directly after the last word?

share|improve this question
up vote 0 down vote accepted

Try a simple string replacement. The following is untested:

    function fabs_excerpt_more($output) {
     global $post;
$output = str_replace('</p>', '<a class="more" href="'. get_permalink($post->ID) . '">></a></p>', $output);
     return $output;
    add_filter( 'excerpt_more', 'fabs_excerpt_more' );
share|improve this answer

Your Answer


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.