Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #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 expecting

    Using 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 35px

    Now 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 35

    Cheers,
    Paul

    #1122078

    Hey Paul,
    Thanks for the details, but please include a link to your page so we can examine the sectors.

    Best regards,
    Mike

    #1122101

    you 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.

    #1122102

    if 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/

    #1122106

    or 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

    #1122238

    Hi,

    Thanks for helping out @guenni007, did you have any luck with that solution @euroson?

    Best regards,
    Rikard

    #1122303

    if 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

    #1122351

    Hi,
    Thanks for helping out @Guenni007

    Best regards,
    Mike

    #1123945

    Hi 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,
    Paul

    #1123991

    All 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.
    Film

    #1125330

    Hey 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

    #1125342

    Read 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. pp

    the 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-1122102

    #1221582

    Hey 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.

    #1221599

    @DimaP : this is long time ago – why don’t you use the alb itself and goto Advanced Tab of the Slide Image:

    #1221743

    Wow! 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;
    }

    #1221938

    Hi DimaP,

    Please try this instead:

    .h1color_white {
      color: #ffffff !important;
    }

    If that doesn’t work then please post a link to where we can see the actual element.

    Best regards,
    Rikard

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.