-
AuthorPosts
-
July 24, 2019 at 4:32 pm #1121615
Hello Everyone,
I would like to make an H1 tag from the Caption Title within the Fullscreen Slider element but it doesn’t seem to be giving me the results I’m expectingUsing the Avia Layout Builder, here are the steps I took for the initial slider creation:
1. Add Fullscreen Slider from the Media Elements tab
2. Add an image to the slide show
3. Enter “POINT STORAGE MANAGER” in the Caption Title box and set to font size 70px
4. Enter “Archiving Solutions for Windows, NetApp, EMC, and NAS Systems” in the Caption Text box and set to 35pxNow that I’d like to make POINT STORAGE MANAGER an H1 tag, I first tried just the basics of adding <h1> and </h1> before and after the Caption Title text. This did work in terms of making the Caption an H1 tag, but it changed the color of the Caption from white to black, and also reduced the font size to what looks to be more like 25px.
I then fiddled with strings like style=”color:#FFFFFF” to retain the white color, and style=”font-size:70px to retain the original font size, but these didn’t seem to work either. Please note I’m not a web designer or HTML programmer, so I gave it my best shot at adding these items to the string, which I may have done incorrectly
So, if anybody can provide the correct syntax (or alternate workaround) that would be great. I’d like to:
1. Make the Caption Title POINT STORAGE MANAGER an H1 tag
2. Set or retain the color as white
3. Set or retain the font size as 70px
4. Leave the Caption Text as Archiving Solutions for Windows, NetApp, EMC, and NAS Systems
5. Set or retain the color as white
6. Set or retain the font size as 35Cheers,
PaulJuly 26, 2019 at 5:47 am #1122078Hey Paul,
Thanks for the details, but please include a link to your page so we can examine the sectors.Best regards,
MikeJuly 26, 2019 at 8:07 am #1122101you can put this into your child-theme functions.php:
function my_avf_customize_heading_settings( array $args, $context, array $extra_args = array() ) { if( $context == 'avia_slideshow' ) { $args['heading'] = 'h1'; $args['extra_class'] = 'is-h1'; } return $args; } add_filter( 'avf_customize_heading_settings', 'my_avf_customize_heading_settings', 10, 3 );
just give that custom-class ( in my case it is : is-h1 ) to the fullscreen-slider
every slide-show with that class will turn the default h2 to h1 tag then.
July 26, 2019 at 8:13 am #1122102if you like to set the heading tag on each slide in a different way – you can use my edited enfold alb elements.
But read carefully – on slider you need 4 files to substitute: https://webers-testseite.de/edited-enfold-alb-elements/July 26, 2019 at 8:28 am #1122106or if you do not like to use the edited alb elements you can replace only that specific heading by this function in child-theme functions.php:
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('.page-id-14 .avia-slideshow-1 .slide-1 h2.avia-caption-title', '<h1></h1>'); }(jQuery)); </script> <?php } add_action('wp_footer', 'replace_tags_with_tags');
you see that line:
replaceElementTag('.page-id-14 .avia-slideshow-1 .slide-1 h2.avia-caption-title', '<h1></h1>');
you can add there as many lines as you like – if you are more specific with the selector you can be very strict in replacing
these lines must be semicolon separated.F.e. – if you have there :
replaceElementTag('.slide-1 h2.avia-caption-title', '<h1></h1>');
every first slide in a slide-show will have a h1 tag then
July 27, 2019 at 5:31 am #1122238Hi,
Thanks for helping out @guenni007, did you have any luck with that solution @euroson?
Best regards,
RikardJuly 27, 2019 at 11:30 am #1122303if you only have that on the given page and do not need to have that elsewhere i recommend to use: https://kriesi.at/support/topic/how-do-i-create-h1-tag-from-the-caption-title-in-fullscreen-slider-element/#post-1122106
July 27, 2019 at 4:30 pm #1122351Hi,
Thanks for helping out @Guenni007Best regards,
MikeAugust 1, 2019 at 4:51 pm #1123945Hi Guys,
Thanks for the feedback and suggestions. Sorry for the delay in replying, I got pulled away on a few other tasks since I posted the question. It may be another week or so until I get back on the h1 tags, but in the interim here is a link to the page I used in my example
Regards,
PaulAugust 1, 2019 at 10:39 pm #1123991All is said in detail above: now your page-id is 309
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('.page-id-309 .avia-slideshow-1 .slide-1 h2.avia-caption-title', '<h1></h1>'); }(jQuery)); </script> <?php } add_action('wp_footer', 'replace_tags_with_tags');
the only thing to do is now to give the h1 then a white color:
see if i simulate the jQuery on developer tools.
FilmAugust 7, 2019 at 1:29 am #1125330Hey Guenni,
if i use your code it changes all tags to h1 automatically. But not if i set the css class “is-h1”.
Bests, Ronald
August 7, 2019 at 2:33 am #1125342Read carefully – i give you more than one solution.
It depends on what you like to do.
If you only want to change the the heading of the first slide – or if you want to change all headings of the slider. etc. ppthe line :
replaceElementTag('.page-id-309 .avia-slideshow-1 .slide-1 h2.avia-caption-title', '<h1></h1>');
is for what you like to transform.
it is only for that specific page: page-id-309
it is only for the first slider on that page: avia-slideshow-1
it is only for the first slide : slide-1
if you erase that : slide-1 class – then all headings in the first slider will be replaced
_________________________the method with the “is-h1” is another method – but that will replace all headings of the slider.
____________________
for me it is important to have the complete possibility to set the heading tag on each slide – so i decided to edit this alb element to have an input field for heading-tag. – that was the method mentioned here: https://kriesi.at/support/topic/how-do-i-create-h1-tag-from-the-caption-title-in-fullscreen-slider-element/#post-1122102June 11, 2020 at 9:45 am #1221582Hey Guenni,
did u find solution of how to do the same as above but for the latest update meant v4.7.5? I have my very 1st page with the Fullscreen slider within which is domain/wp-admin/post.php?post=143&action=edit so what about the right function to work out?
Best,
Dmitry.June 11, 2020 at 10:16 am #1221599@DimaP : this is long time ago – why don’t you use the alb itself and goto Advanced Tab of the Slide Image:
June 11, 2020 at 4:06 pm #1221743Wow! Thanks a lot, I didn’t dig inside so deep… Anyway, I have changed the header for H1, now trying to change the color from just black to white. I made my customs CSS class as h1color_white and put this code w/ success… Anything wrong?
#h1color_white .main_color h1 {
color: #ffffff !important;
}June 12, 2020 at 5:20 am #1221938 -
AuthorPosts
- You must be logged in to reply to this topic.