generate_page_hero_post_author

generate_page_hero_post_author

The generate_page_hero_post_author allows us to alter the HTML of the post author when using {{post_author}} template tag in header element.

Example

If we don』t want a link surrounding the post author:

add_filter( 'generate_page_hero_post_author', function() {
global $post;
$author_id = $post->post_author;

return sprintf( '%s',
esc_html( get_the_author_meta( 'display_name', $author_id ) )
);
} );

发表回复

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