generate_site_title_output

generate_site_title_output

The generate_site_title_output allows allows us to alter the HTML of our site title.

Example

If we don』t want a link surrounding the title:

add_filter( 'generate_site_title_output', function( $output ) {
return sprintf(
'
%3$s
',
( is_front_page() && is_home() ) ? 'h1' : 'p',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
get_bloginfo( 'name' )
);
});

发表回复

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