Archived topic
Remove doble h1 in my home page
8 replies · Started by Felipe on April 15, 2020
How to remove the double H1 that my website has? I need that there is only one H1 and that this is not that of the Header, but that of the text that I put with a hook in the home page.
I trying modify this block code, but not working for me.
// Build our site title.
$site_title = apply_filters( 'generate_site_title_output', sprintf(
'<%1$s class="main-title" itemprop="headline">
<a href="%2$s" rel="home">
%3$s
</a>
</%1$s>',
( is_front_page() && is_home() ) ? 'h1' : 'p',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
get_bloginfo( 'name' )
) );
Hi there,
Try this PHP snippet here:
https://generatepress.com/forums/topic/gp-marketer-site-title/#post-990243
Adding PHP: https://docs.generatepress.com/article/adding-php/
This should make the site title to be a <p> instead of <h1>
Thank you very much, I just added it with the help of the code "Code Snippets" and I have placed it like this:
add_filter( 'generate_site_title_output', function( $output ) {
return sprintf(
'<%1$s class="main-title" itemprop="headline">
<a href="%2$s" rel="home">
%3$s
</a>
</%1$s>',
( is_front_page() && is_home() && !is_paged()) ? 'p' : 'h1',
esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
get_bloginfo( 'name' )
);
} );
;)
How I remove URL input field in comment form?
Well, i use this snippet
add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
function tu_add_comment_url_filter() {
add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
}
function tu_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}
Looks good to me. Everything working as it should now? :)
yes, sir, thank!
Awesome :)