Tagged: H1
-
AuthorPosts
-
July 25, 2018 at 6:50 pm #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 advanceJuly 26, 2018 at 5:32 am #990050Hey 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,
MikeJuly 26, 2018 at 8:22 am #990101This reply has been marked as private.July 26, 2018 at 1:11 pm #990230Hi,
Please include a admin login & FTP access in the Private Content area, I will take a look.Best regards,
MikeJuly 26, 2018 at 2:01 pm #990252this 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/#slidersJuly 26, 2018 at 4:47 pm #990309This reply has been marked as private.July 26, 2018 at 5:05 pm #990317This reply has been marked as private.July 26, 2018 at 9:22 pm #990441Hi 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,
VictoriaJuly 26, 2018 at 9:54 pm #990468to 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');
July 27, 2018 at 2:30 am #990522Hi,
@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,
MikeJuly 27, 2018 at 8:38 am #990570This reply has been marked as private.July 27, 2018 at 8:39 am #990571This reply has been marked as private.July 27, 2018 at 9:13 am #990579the 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
July 27, 2018 at 12:07 pm #990654Hi,
@Guenni007 thanks, very handy.
@SANDYAMAR unless there is anything else we can help with on this issue, shall we close this then?Best regards,
MikeJuly 28, 2018 at 7:38 am #990900This reply has been marked as private.July 28, 2018 at 3:11 pm #990920Hi,
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 -
AuthorPosts
- The topic ‘Replace a H2 by H1 in a easy slider fullpage’ is closed to new replies.