ExtendStudio / mesmerize

GNU General Public License v3.0
4 stars 2 forks source link

Excerpt More #13

Closed sakinshrestha closed 7 years ago

sakinshrestha commented 7 years ago

Make sure excerpt_more filter does not affect admin side. Your code lines 381 onwards in inc/functions.php should look like this:

/**
 * Replaces "[...]" (appended to automatically generated excerpts) with ... and
 * a 'Read more' link.
 *
 * @return string '... Read more'
 */
function mesmerize_excerpt_more( $more ) {
    if ( ! is_admin() ) {
        return '&hellip; <br> <a class="read-more" href="' . esc_url(get_permalink(get_the_ID())) . '">' . esc_html__('Read more', 'mesmerize') . '</a>';
    }
}
add_filter('excerpt_more', 'mesmerize_excerpt_more');