• Resolved mocreate

    (@mocreate)


    This function allows me to change the text of .more-link, but when I have an excerpt, the button disappears in my blog posts. Is there a way to modify this function so I can populate the excerpt and still have the ‘continue reading’ link appear:

    // Replaces “[…]” (appended to automatically generated excerpts) with “…” and a Continue reading link.
    if ( ! function_exists( ‘wpforge_excerpt_more’ ) && ! is_admin() ) :
    function wpforge_excerpt_more( $more ) {
    $link = sprintf( ‘%2$s‘,
    esc_url( get_permalink( get_the_ID() ) ),
    /* translators: %s: Name of current post */
    sprintf( __( ‘Continue reading %s <span class=”meta-nav”>»</span>’, ‘wp-forge’ ), ‘<span class=”screen-reader-text”>’ . get_the_title( get_the_ID() ) . ‘</span>’ )
    );
    return ‘ … ‘ . $link;
    }
    add_filter( ‘excerpt_more’, ‘wpforge_excerpt_more’ );
    endif;

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘.more-link for populated excerpts’ is closed to new replies.