Tagged: enfold, ismael, post title
-
AuthorPosts
-
April 22, 2017 at 5:00 pm #781698
Hi all,
Using “show title and breadcrumbs” option activated, the title of the page appears as
<a>
and not<h1>
as it should. Same happens with Woocommerce products.How can I change this to
<h1>
without having to “hack” Enfold code (as it would probably disappear in the next update)?- This topic was modified 7 years, 7 months ago by rmf339. Reason: I always forget that this forum system applies code on the messages…
April 22, 2017 at 11:16 pm #781820April 24, 2017 at 3:57 pm #782374Hi @Mike,
I always forget that this forum system applies code on the messages… My original message was:
Hi all,
Using “show title and breadcrumbs” option activated, the title of the page appears as
<a>
and not<h1>
as it should. Same happens with Woocommerce products.How can I change this to
<h1>
without having to “hack” Enfold code (as it would probably disappear in the next update)?Anyway… moving on to your comments, I was talking about the post title (in this case the post is a page or a product), which is located in the same
<div class="container">
as the breadcrumbs above the fullwidth imageshow. Note that it is uses STRONG and A tags. I want to change them both to H1 (without STRONG).The one you pointed on the screenshot is actually a
<H2>
tag put there with the text element in Avia page builder. And that’s actually correct. But thanks for taking a look at it.Can you help me finding out how to change the post title from A and STRONG to H1 without losing the change on upcoming Enfold updates?
- This reply was modified 7 years, 7 months ago by rmf339.
April 24, 2017 at 4:27 pm #782419Hi @mike,
I noticed that this behavior only happens in Woocommerce products post type. When it’s a WordPress normal page, it behaves like it should… Check the post title in the attached link.
April 24, 2017 at 7:46 pm #782494Hi guys,
I was able to change post titles with the following (in functions.php):
add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
function fix_single_post_title($args,$id){
if (is_product()){
$args['heading'] = 'h1';
}
return $args;
}
Now I need a similar filter to change the h2 tags on product slider as shown on attached link.
Thanks!
April 28, 2017 at 7:09 am #784315Hi,
Glad that you found the filter. However, I can’t find any heading tags in the slider. Could you please provide a screenshot of the element that you want to alter?
Best regards,
IsmaelApril 28, 2017 at 4:31 pm #784684OK @ismael, here it goes: http://www.nattrip.com.br/site2017/wp-content/uploads/2017/04/DEBUG02.jpg
If you get a 404 when you access the media, please remove
/site2017
And retry!
- This reply was modified 7 years, 7 months ago by rmf339.
April 30, 2017 at 3:55 pm #785276Hi rmf339,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look.
Best regards,
VictoriaMay 2, 2017 at 3:26 pm #786424Hi @victoria_d, how are you?
I actually didn’t understand why you want admin access to my website. Could you go through the support ticket again to see if you missed something?
In the case you still need access, could you briefly explain me why?
Best regards and thank you!
- This reply was modified 7 years, 6 months ago by rmf339.
May 2, 2017 at 5:23 pm #786560Hi rmf339,
I wanted to see how the page is built and see your functions.php, since your function does not remove the link, just changes strong to h1.
Best regards,
VictoriaMay 2, 2017 at 7:48 pm #786647That’s because in the function
fix_single_post_title($args,$id)
that I’ve added to functions.php I just change the following variable to H1
$args['heading']
So the link remains…Please check this screenshot: SHOT Main title for products
Taken from this page: Product Pedra da Gavea
May 2, 2017 at 8:08 pm #786654Hi,
You want to remove the args[‘link’] from the filter?
Best regards,
BasilisMay 2, 2017 at 8:43 pm #786688No, not me… just wanted it to be H1…
The link suits me too.
May 2, 2017 at 8:57 pm #786696Hi rmf339,
Best regards,
VictoriaAugust 5, 2020 at 1:19 am #1235258Hello I have the same problem! How do I resolve? Products and portfolios do not have an h1 title
August 6, 2020 at 1:59 pm #1235721Hi,
@rsilvestre the title in the title bar with the breadcrumbs has been left as an “a” to have uniformly across the site.
For example, the single product pages have the H1 in the product summary above the price, in Posts the H1 is in the “entry-content-header” and so on, since we only want one H1 per page.
If you are creating custom product pages with the Advanced Layout Builder then you may need to add the H1 manually to the product pages.Best regards,
MikeAugust 7, 2020 at 9:59 pm #1236140Hello friend, thanks for the reply, I believe you can help me a little more … I already have more than 100 products created, it would be very bad for me to have to insert the title h1 product by product.
I saw above that a participant found the solution, but I need that solution or a code, to be provided by some moderator of the enfold.
Could you send me a code so that I can insert it into the enfold theme and all products have h1 in the main title?
August 7, 2020 at 10:01 pm #1236141Yes, I’m using Advanced Layout Builder.
August 8, 2020 at 2:40 pm #1236206Hi,
@rsilvestre for single product pages, Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_script(){ ?> <script> jQuery(window).load(function(){ var el = document.querySelector('#top.single-product .main-title.entry-title '); el.outerHTML = '<h1 class="main-title entry-title">' + el.innerHTML + '</h1>'; }); </script> <?php } add_action('wp_footer', 'custom_script');
If you have single product pages that you don’t want this to work on please link to a sample page for both so we can examine them.
Please note that the style of the title doesn’t change but the H1 is added, you can change the style with css like this:#top.single-product h1.main-title.entry-title { font-size: 30px; font-weight: bold; }
Please clear your browser cache when you check.
Best regards,
MikeAugust 10, 2020 at 10:34 pm #1236525Thank you very much friend, solved my problem. God bless
August 10, 2020 at 11:02 pm #1236534Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonAugust 19, 2020 at 3:21 pm #1239198Hi Mike, how are you? I would like to ask you for help in another topic that I created, the moderator Vitoria is not able to help me … I noticed in other topics that people also have difficulty when she answers something.
I would like you to help me in this topic: https://kriesi.at/support/topic/product-title-is-not-h1-and-filter-is-not-translate-in-enfold-woocommerce/#post-1239197
I am not able to translate woocommerce filters on enfold.
August 22, 2020 at 7:09 pm #1239982 -
AuthorPosts
- The topic ‘Enfold page/product title is A tag, not H1 tag’ is closed to new replies.