Tagged: product category page
-
AuthorPosts
-
November 15, 2021 at 12:53 am #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
November 15, 2021 at 2:51 am #1328998Hey 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,
IsmaelNovember 16, 2021 at 9:38 am #1329182Hi 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
November 16, 2021 at 11:59 am #1329196Hi,
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,
IsmaelNovember 16, 2021 at 12:06 pm #1329197Hi 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
November 18, 2021 at 3:24 am #1329399Hi,
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,
IsmaelNovember 18, 2021 at 3:26 am #1329400Hi,
UPDATE: We added the is_product_category conditional function to ensure that it only removes the title on the product category pages.
Best regards,
IsmaelNovember 19, 2021 at 12:36 am #1329579Hi Ismael,
thanks – now it works!
Best regards!
TobiasNovember 19, 2021 at 1:40 pm #1329681 -
AuthorPosts
- The topic ‘Enfold product category douple h1’ is closed to new replies.