Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1451383

    Good morning,

    on my portfolio page, I find 3 H1 tags which penalize SEO

    , how can I fix this problem without affecting the rest of the site?

    thank you for your comeback

    #1451396

    Hey YMen45,
    Thank you for the link to your site, the title bar h1.main-title is the correct h1 for the page, but I see that you manually added two more on the page
    Enfold Support 6113
    use the following code at the end of your child theme functions.php file in Appearance ▸ Editor to change the correct one to a “p” tag, and then you can change the two manually added ones to use just one H1 tag.

    function custom_script() { ?>
      <script>
    (function($) {
        function replaceElementTag(targetSelector, newTagString) {
          $(targetSelector).each(function(){
            var newElem = $(newTagString, {html: $(this).html()});
            $.each(this.attributes, function() {
              newElem.attr(this.name, this.value);
            });
            $(this).replaceWith(newElem);
          });
        }
        replaceElementTag('.page-id-4783 h1.main-title.entry-title', '<p></p>');
    }(jQuery)); 
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script', 99 );

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1451610
    This reply has been marked as private.
    #1451618

    Hi,
    The use this to make “Portfolio” h2

    function custom_script() { ?>
      <script>
    (function($) {
        function replaceElementTag(targetSelector, newTagString) {
          $(targetSelector).each(function(){
            var newElem = $(newTagString, {html: $(this).html()});
            $.each(this.attributes, function() {
              newElem.attr(this.name, this.value);
            });
            $(this).replaceWith(newElem);
          });
        }
        replaceElementTag('.page-id-4783 h1.main-title.entry-title', '<h2></h2>');
    }(jQuery)); 
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script', 99 );

    and manually change “NOS REALISATIONS EN CREATION DE SITES INTERNET” as h1
    “Découvrez notre portfolio” is h2
    as they look to be in a text element that you manually added.

    Best regards,
    Mike

    #1451620
    This reply has been marked as private.
    #1451624

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘triple H1 on a page where there is only the portfolio (except header and footer)’ is closed to new replies.