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' )
);
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注