-
AuthorPosts
-
May 3, 2017 at 1:59 pm #787138
Hey guys,
I want to remove h1 tag from category based shop sites (url.de/produkt-kategorie/xxx). I dont want to hide them only, I need to remove it complete. Is there any hook to remove the h1 functions from standard template (category)?
<h1 class=’main-title entry-title’></h1>
best regards
alexMay 3, 2017 at 2:44 pm #787159Hey combra,
Try adding the following to functions.php
add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { $args['title'] = get_the_title($id); $args['link'] = ""; $args['heading'] = 'h1'; return $args; }
Adjust the h1 to what you want.
Best regards,
Jordan ShannonMay 3, 2017 at 3:02 pm #787171Hey Jordan,
thank you. But this dosent do what I need or do I need to add something else myself? I would like to remove the given headings including <h1> …. </ h1> on all categorys.
Best regards
AlexMay 3, 2017 at 3:16 pm #787176Hi,
Are you looking to replace with another h2-6 tag or remove altogether?
Best regards,
Jordan ShannonMay 3, 2017 at 3:30 pm #787189I want to delete the completely. But only those that are given by the template. The defined by me should be in it.
this should be deleted:
<h1 class=’main-title entry-title’></h1>
<h1 class=”page-title”></h1>
May 3, 2017 at 5:03 pm #787244Hi,
It should be possible to do this via javascript, but I would need to work it out via the admin if you are able to provide login info.
Best regards,
Jordan ShannonMay 4, 2017 at 1:48 pm #787807Hey, thanks for your reply. It wouldnt be a problem to gave admin access. But I dont know why you want to do it with JS?
May 4, 2017 at 4:26 pm #787924Hi,
JS may be the quicker solution if you want to target specific pages, but perhaps I am misunderstanding.
Please go to plugins/woocommerce/templates/archive-product.php:
Search for and remove/edit the following:
<h1 class="page-title"><?php woocommerce_page_title(); ?></h1>
Next, please go to themes/enfold/functions-enfold.php:
On line 377 (or near) remove/edit the following:
'heading_html' => "<{heading} class='main-title entry-title'>{title}</{heading}>",
Let me know if this works for you.
Best regards,
Jordan ShannonMay 5, 2017 at 11:40 am #788325Thanks. This soultion would be delted on any update of woocommerce? And it would delete all headings, not only on categorys or? I will back to you with admin access. (I do not have access right now).
May 5, 2017 at 3:04 pm #788422Hi,
To protect updates you should create a child theme, which would include a functions.php file where you can write custom functions that use the many built-in WooCommerce actions and filters that allow you to modify functionality. Read through WooCommerce documentation for more info.
Best regards,
Jordan Shannon -
AuthorPosts
- You must be logged in to reply to this topic.