Tagged: Fullwidth easy slide, header tags
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
August 25, 2024 at 1:02 pm #1465340
I found below code to place in the functions.php file to change h2 tags in the Fullwidth easy slider:to h1. However, now I have several h1 tags, which I don’t want either. I’m looking for a way to set the first titel to h1, the others to h2. how do I do this?
*Change h2 tag full width slider to h1 */ 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');August 25, 2024 at 3:36 pm #1465352Hey Peter,
To have only the first slide title changed to H1 try this instead:function replace_first_slide_title_tag(){ ?> <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('.slide-1 .slideshow_caption h2.avia-caption-title', '<h1></h1>'); }(jQuery)); </script> <?php } add_action('wp_footer', 'replace_first_slide_title_tag');Best regards,
MikeAugust 25, 2024 at 5:04 pm #1465358you my kind Sir deserve a statue! works like a charm. many thanks!
August 25, 2024 at 5:08 pm #1465359Hi,
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 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Fullwidth easy slider: setting first titel to H1, others to H2.’ is closed to new replies.
