Tagged: 

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #989878

    Hello
    I have built all my pages with a Fullpage Easy slider on the top and i’ve just noticed that the text (legend) is set up as H2 by default, that it is a big problem in terms of SEO
    How can I replace the H2 by H1 in this specific slider?
    Many thanks in advance

    #990050

    Hey SANDRINE,
    For changing the slider h2 to h1, for this one page,
    please try adding this code to the end of your functions.php file in Appearance > Editor:

    function slider_h2_to_h1(){
      if ( is_page('7') ) { ?>
      <script>
      jQuery(window).load(function(){
      var el = document.querySelector('.avia-caption-title');
          el.outerHTML = '<h1 class="avia-caption-title ">' + el.innerHTML + '</h1>';
      });
      
      </script>
      <?php }
      }
      add_action('wp_footer', 'slider_h2_to_h1');

    Then add this code in the General Styling > Quick CSS field:

    h1.avia-caption-title {
        font-size: 60px !important; 
        color: #ffffff !important; 
    }

    Best regards,
    Mike

    #990101
    This reply has been marked as private.
    #990230

    Hi,
    Please include a admin login & FTP access in the Private Content area, I will take a look.

    Best regards,
    Mike

    #990252

    this solution ( you can get rid of the if is_page when you want to be active on all sites) will work.
    On future Projects you can use my edited alb elements where you have the choice to set the h-tag as you like!
    https://webers-testseite.de/edited-enfold-alb-elements/#sliders

    #990309
    This reply has been marked as private.
    #990317
    This reply has been marked as private.
    #990441

    Hi Sandrine,

    Well, if you are not comfortable making changes and this seems too complex, you might want to hire a freelancer to do it for you.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #990468

    to change all captions from h2 to h1 put this into your functions.php of your child-theme:

    
    
    function replace_tags_with_tags(){
    ?>
    <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('.slideshow_caption h2.avia-caption-title', '<h1></h1>');
      }(jQuery)); 
    </script>
    <?php
    }
    add_action('wp_footer', 'replace_tags_with_tags');
    #990522

    Hi,

    @SANDYAMAR
    thanks for the ftp access, I added @Guenni007 code from above and see that it has changed all of the slider caption H2 tags to H1. It also retains the inline css and classes, so there be no need to add more css, as in my example.
    Thanks @Guenni007, well done :)

    Please clear your browser cache and check.

    Best regards,
    Mike

    #990570
    This reply has been marked as private.
    #990571
    This reply has been marked as private.
    #990579

    the whole function can be used for more replacements – just add a new line – semicolon separated

    replaceElementTag('.slideshow_caption h2.avia-caption-title', '<h1></h1>');
    replaceElementTag('#footer h3.widgettitle', '<h2></h2>');  

    etc.pp

    #990654

    Hi,

    @Guenni007
    thanks, very handy.

    @SANDYAMAR
    unless there is anything else we can help with on this issue, shall we close this then?

    Best regards,
    Mike

    #990900
    This reply has been marked as private.
    #990920

    Hi,
    Glad @Guenni007 was able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Replace a H2 by H1 in a easy slider fullpage’ is closed to new replies.