Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #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, 8 months ago by rmf339. Reason: I always forget that this forum system applies code on the messages…
    #781820

    Hey Rodrigo,
    That title appears to be a text block element, so you can easily change it from h2 to h3 in the editor.
    postimage

    Best regards,
    Mike

    #782374

    Hi @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, 8 months ago by rmf339.
    #782419

    Hi @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.

    #782494

    Hi 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!

    #784315

    Hi,

    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,
    Ismael

    #784684

    OK @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, 8 months ago by rmf339.
    #785276

    Hi 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,
    Victoria

    #786424

    Hi @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, 7 months ago by rmf339.
    #786560

    Hi 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,
    Victoria

    #786647

    That’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

    #786654

    Hi,

    You want to remove the args[‘link’] from the filter?

    Best regards,
    Basilis

    #786688

    No, not me… just wanted it to be H1…

    The link suits me too.

    #786696

    Hi rmf339,

    Best regards,
    Victoria

    #1235258

    Hello I have the same problem! How do I resolve? Products and portfolios do not have an h1 title

    #1235721

    Hi,

    @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,
    Mike

    #1236140

    Hello 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?

    #1236141

    Yes, I’m using Advanced Layout Builder.

    #1236206

    Hi,

    @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,
    Mike

    #1236525

    Thank you very much friend, solved my problem. God bless

    #1236534

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1239198

    Hi 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.

    #1239982

    Hi,
    Sorry for the late reply, I have taken a look at the other thread and posted a reply. We will continue there.

    Best regards,
    Mike

Viewing 23 posts - 1 through 23 (of 23 total)
  • The topic ‘Enfold page/product title is A tag, not H1 tag’ is closed to new replies.