Show Excerpt and Readmore Link

Hi there,

 

If you don't want to use the Readmore tag provided by wordpress and instead you want to use the excerpt you know that this content doesn't have the read more link, it use [...] by default.

 

So, if you want to add the read more link to your excerpt use this function in your functions.php file.

 

function yit_show_more_excerpt( $excerpt ) {
    global $post;

    $permalink = get_permalink( $post->ID );
    $title     = $post->post_name;
    $more      = yit_get_option( 'blog-read-more-text' );
    $more      = $more ? $more : 'Read more';
    $more      = '<a href="' . $permalink . '" title="' . $title . '">' . sprintf( __( '%s', 'yit' ), $more ) . '</a>';

    return ( $excerpt . ' ' . $more );
}
add_filter( 'get_the_excerpt', 'yit_show_more_excerpt' );

 

Tested in Bishop and Mindig

For any question, doubt or anything else, leave a reply.

Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk