Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1328988

    Hi Support,

    wonder about there is no solution to did a right seo product category page. when we use the “Display product image and description as fullwidth page banner” on the product category page and write a text in description box we got a douple H1 tag.

    We think kriesi team can optimize the product category page. if someone use the description box h1 tag should be disable.

    How can we disable the second h1 tag in <h1 class="woocommerce-products-header__title page-title">Pfeffer</h1>?

    Thanks for your help!

    Best regards!

    Tobias

    #1328998

    Hey Tobias,

    Thank you for the inquiry.

    The default product header should be disabled by default. Did you add any hooks or filters in the functions.php file, or did you modify any product templates?

    To remove the title back, please add this code in the functions.php file.

    add_action('after_setup_theme', function() {
       if( is_product_category() ) {
           add_filter('woocommerce_show_page_title', "__return_false");
       }
    }, 10);
    

    Best regards,
    Ismael

    #1329182

    Hi Ismael,

    thanks for your help!

    No, we doesn´t modify the product template. we have hooks in child theme but no hooks for woocommerce product category pages. I try disable all custom changes, but your code doesn´t work.

    Any Idea?

    Best regards!

    Tobias

    #1329196

    Hi,

    Thank you for the login token.

    We adjusted the filter in the functions.php file a bit. This removes the h1 tag in the default product header.

    add_filter('woocommerce_show_page_title', function($enable) {
    	return true;
    }, 10, 1);
    

    Please make sure to purge or flush the cache before checking the page.

    Best regards,
    Ismael

    #1329197

    Hi Ismael,

    think this is a misunderstanding. we just want to remove the product title on the product category page. but your code doesn´t work. Please have a look at private content link.

    Thanks a lot

    Best regards!

    Tobias

    #1329399

    Hi,

    How can we disable the second h1 tag in

    woocommerce-products-header__title page-title">Pfeffer

    ?

    That is what you said in your initial reply and the filter that we added above actually removes that element. Please check the screenshot below showing the page without the duplicated title.

    Screenshot: https://imgur.com/1ZyfWhr

    Thank you for your patience.

    Best regards,
    Ismael

    #1329400

    Hi,

    UPDATE: We added the is_product_category conditional function to ensure that it only removes the title on the product category pages.

    Best regards,
    Ismael

    #1329579

    Hi Ismael,

    thanks – now it works!

    Best regards!
    Tobias

    #1329681

    Hi,

    Great! Glad to know that it is working. Please let us know if you need anything else. We will close this thread for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Enfold product category douple h1’ is closed to new replies.