generate_content_more_link_output

generate_content_more_link_output

The generate_content_more_link_output filter allows you to change the HTML markup of your read more link inside your blog post excerpts when using the more tag.
Default:
sprintf( '

%3$s

',
the_title_attribute( 'echo=0' ),
esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
__( 'Read more', 'generatepress' )
);
Usage
For example, if we wanted to change the class of our paragraph surrounding the link, we could do this:
add_filter( 'generate_content_more_link_output','tu_change_content_more_link' );
function tu_change_content_more_link() {
return sprintf( '

%3$s

',
the_title_attribute( 'echo=0' ),
esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
__( 'Read more', 'generatepress' )
);
}

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註