Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1303031

    Hi –

    I’m reviewing my core web vitals (as is everyone else!) and getting a mobile CLS score of 0.35. I worked with a developer on my site but she seems to have disappeared – so I’m stuck fixing this on my own and my skills are mediocre, at best. (it’s why I extended my support…. not sure how that differs from the regular forum?)

    This is my dev site: https://tssdevsite.xyz/

    I’m getting 2 big layout shifts on my HP:

    Buy Now (hero image in layerslider): 0.242
    <div id=”layer_slider_2″ class=”avia-layerslider main_color avia-shadow avia-builder-el-2 el_after_av_laye…” style=”height: auto; max-width: 990px; margin: 0px auto;”>

    Get shorter straps without sewing Love it or your Money Back Free Shipping i… (grey area right below hero) 0.086
    <div id=”av_section_1″ class=”avia-section main_color avia-section-no-padding avia-no-border-styling av…” style=”background-color: #efefef; margin-top:10px; margin-bottom:0px; “>

    How can I fix this? It looks like maybe defining the container size? If so, can you point me in the right direction on how to do that?

    Thanks so much!
    Shari

    #1303344

    Hey sldeutsch,

    Thank you for the inquiry.

    We added this css code in the Quick CSS field to apply a minimum height to the layer slider and the section with the testimonials, which should prevent the content from shifting when the layer slider finally loads and when the testimonial slider transitions from the current slide to the next.

    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        min-height: 272px;
        height: 272px;
    }
    
    .home #av_section_4 .container {
        min-height: 430px;
    }
    

    This seems to improve the CLS score on desktop, but the site still requires further optimization. Please check the following articles for more info about site optimization in general.

    // https://kriesi.at/archives/scoring-100-100-in-google-pagespeed-insights-gtmetrix-pagespeed-and-yslow
    // https://gtmetrix.com/wordpress-optimization-guide.html

    Best regards,
    Ismael

    #1303375

    @Ismael is right with his solution.
    Start from the top of the page and work downwards. CLS shift tends to only apply on above the fold because the rest of the page loads out of view.

    If you can remove the shift from the first element on all devices then the rest may no longer be an issue. As they are all ALB colour sections, if you know that it will dynamically resize, set no minimum height. If it has a background image set then you may still experience some shift. You will need to create a version of the code below for that element.

    The Layerslider needs an explicitly stated height to prevent shift. ALB background elements and Sliders also have this issue. You essentially need a few rules to match the design:

    Below is suitable for the layerslider. HOWEVER you may need to apply it to the colour section and the background image as well to prevent the shift. I tend to set a custom ID so that the rule only applies to this element. See how you get on with the below:

    /* Desktops 1080p */
    @media screen and (min-width:1441px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 271px !important;
    }
    }
    
    /* Macbooks, 720p and ipad pros  */
    @media screen and (min-width:1025px) and (max-width:1440px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 272px !important;
    }
    }
    
    /* Ipads landscape */
    @media screen and (min-width:769px) and (max-width:1024px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 271px !important;
    }
    }
    
    /* Ipads portrait */
    @media screen and (min-width:451px) and (max-width:768px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 271px !important;
    }
    }
    
    /* mobiles portrait */
    @media screen and (min-width:361px) and (max-width:450px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 321px !important;
    }
    }
    
    /* Moto G4 portrait */
    @media screen and (max-width:360px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 271px !important;
    }
    }
    • This reply was modified 3 years, 6 months ago by thinkjarvis.
    #1303479

    Hi @thinkjarvis and @Ismael,

    Thank you so much for the information – but it must be user error – I put in both pieces of code in the Quick CSS in the child theme and neither made a difference. My CLS is the same. Is there something else that I need to do? Did I put it in the wrong spot? (maybe within layerslider?) I’m such a beginner – which is why I purchased support. (my developer abandoned me!) I’m not sure if there is a better way to reach the team?

    Thanks,
    Shari

    #1303677

    @thinkjarvis and @ismael I’m trying to figure out my error: what should I be using as my slider class? I assume that this code goes into Quick CSS in the theme and then I add something into my slider class? I’ve tried every combination that I can imagine and it’s just not making a difference. :(

    Thanks,
    Shari

    #1303949

    Hi,

    We tried to login again to the site, but got temporarily locked out by Wordfence. Did you add the css code in the dev site? Please toggle or temporarily disable the Enfold > Performance > File Compression settings after adding the css code and make sure to purge the cache. You should also test the site on incognito mode, just make sure that nothing is cached.

    Did you add this css code?

    .home #av_section_4 .container {
        min-height: 430px;
    }
    

    This should set a minimum height to the section with the testimonial element and prevent the elements next to it from shifting when it transitions. You may need to replace the #av_section_4 selector with a unique ID or class name.

    // https://kriesi.at/documentation/enfold/add-custom-css/

    Best regards,
    Ismael

    #1304156

    Hi –

    I don’t know why you were blocked – I think maybe you tried the wrong user name? I just confirmed the credentials that I sent and they work! I’m sorry about that!

    As for the CSS – I removed it because I thought I was breaking something – but I put it back in. Here’s what I did – I have no idea if it is right:

    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        min-height: 272px;
        height: 272px;
    }
    
    .home #av_section_4 .container {
        min-height: 430px;
    }

    and then when I added the second part of the code (was I supposed to do that?) it turned the headline in the next section pink. To illustrate, I only added in:

    /* Macbooks, 720p and ipad pros  */
    @media screen and (min-width:1025px) and (max-width:1440px) {
    .home #layer_slider_1 .ls-wp-container, .home #layer_slider_1 .ls-wp-container .ls-inner {
        height: 272px !important;

    You can see the difference once the viewport is smaller than 1027px.

    from this:


    I can’t seem to get an image to appear, if it doesn’t…. https://postimg.cc/34qzPzPk
    to

    2nd image: https://postimg.cc/v4vkQ4JF

    Whatever it is, I’m sure that I did it wrong!

    Now what? :)

    (also, can someone look at https://kriesi.at/support/topic/layerslider-loading-last/#post-1304065 – I’m not getting anywhere there and surely there is a quick answer?!!?)

    • This reply was modified 3 years, 6 months ago by sldeutsch.
    #1304499

    Hi,

    We found a lot of invalid css code in the Quick CSS field and tons of css media query duplicates. Even the css media query that you posted above is missing a closing curly brace. We corrected the invalid css code and combined all css media queries that are the same. We also moved the css media queries at the very bottom of the field.

    Let us know if that helps. We kept the original css code just in case.

    Best regards,
    Ismael

    #1304593

    @ismael

    Sorry I have just realised I missed the closing brackets in my code snippet I have edited my response. Sorry if I have made the job harder for you!

    #1304664

    @Thinkjarvis and @Ismael

    Thank you both and at least I know I’m not going crazy. :) I wouldn’t worry about the original code, per se – I have the code from my prod site, which is my real baseline. I’m still getting pink text in the hero on the mobile, so something still isn’t right… and my layout shift is still the same on mobile and bigger on desktop :( Do you want me to “reset” the CSS so that we can start over?

    I REALLY appreciate the help…. I can’t tell you how frustrating/upsetting this is to me. I’ve been trying to solve this for months!

    thanks,
    Shari

    #1305099

    @Thinkjarvis and @ismael: can you share the right code that you put in my site?

    #1305111

    You have to go through the page from top to bottom to isolate the causes. Unfortunately I would need to quote you for the work if you want me to look at it.

    CLS issues and web vitals work is quite in depth.

    The largest shift is caused by the layer slider image. As suggested you have to explicitly state the height of the element to prevent the shift and should be done to match different device sizes. This can be done in CSS.

    Once the layerslider is no longer causing a shift you may find that the other components load far enough down the page that web vitals no longer considers them a problem.


    @ismael
    may still be able to help you as part of the support team.

    #1305147

    @ThinkJarvis – I thought you were part of the support team! I had no idea! Thank you so much for all of your help and insight. I really appreciate it.


    @ismael
    – I did a compare of the CSS and still didn’t understand exactly what changed. If you could help me out with that, it would be a huge help. (or is it documented somewhere here and I missed it?)

    #1305219

    Hi,

    According to the lighthouse or the page insight tool, these are the sections or elements that are causing layout shifts.

    Screenshots: https://imgur.com/Gj6odFW

    The biggest contributor as suspected, is the layer slide increasing CLS by around 0.2. We have taken care of that by modifying our previous css code.

    .home #layer_slider_1, .home #layer_slider_2, .home #layer_slider_1 .ls-wp-container,
    .home #layer_slider_1 .ls-wp-container .ls-inner, .home #layer_slider_2 .ls-wp-container,
    .home #layer_slider_2 .ls-wp-container .ls-inner {
      min-height: 297px;
      height: 297px;
    }
    

    This is the CLS score on mobile after adding the css code.

    Screenshot: https://imgur.com/FySktKP

    Score on desktop should be the same.

    Best regards,
    Ismael

    #1305244

    Thanks @ismael

    Looks like your solution works but has affected the layout slightly.


    @sldeutsch
    site appears that the layerslider is served at the same height on all screen sizes excluding one.

    I just encountered a similar problem on a client site with an ALB background element that becomes 1400 pixels tall on mobiles.
    The layout shift was 2.48 then down to 0.99 with a min-height on the element within Enfold and then down to 0.01 with an explicitly stated height as per your solution.

    Setting min-height alone only works if the shift on mobiles is minimal so I added the following height:; css.

    This is a specific case where the elements stack. The LCP score is still a bit high but very hard to optimise because the design calls for such a large first element which stacks on mobiles.

    But you get the idea:
    -serve different background image for smaller/taller screens
    -set fixed height for those elements for different screen sizes

    
    /* Media Rules for ALB Colour Element Hero Images */
    
    /* mobiles  */
    @media screen and (max-width:767px) {
    #main-banner-1 {background-image: url(/wp-content/uploads/cbdbgd-wood-5-767-1500-1.jpg)!important;}
    }
    
    /* mobiles  */
    @media screen and (max-width:767px) {
    #main-banner-1 {
    min-height:1400px !important;
    height:1400px !important;
    }
    .tj-main-banner-style {
    min-height:1400px !important;
    height:1400px !important;
    }
    #main-banner-1 .container {
    min-height:1300px !important;
    height:1330px !important;
    }
    }
    
    /* Desktops  */
    @media screen and (min-width:768px) {
    #main-banner-1 {
    min-height:689px !important;
    height:689px !important;
    }
    .tj-main-banner-style {
    min-height:689px !important;
    height:689px !important;
    }
    #main-banner-1 .container {
    min-height:689px !important;
    height:689px !important;
    }
    }
    • This reply was modified 3 years, 6 months ago by thinkjarvis. Reason: Correction
    #1305277

    What the WHAT?!?! :) I will review how you did this and hopefully be able to apply it to my prod site. I’m marginally giddy right now. I can’t tell you how much I appreciate the help that both of you have given me. I’ll give it a try tonight (stupid day job) and let you know how it works. Hopefully this will help me learn how sort out the issues on my other pages, too.

    Thanks for sticking with me and my lack of knowledge (we might not be out of the woods yet, but I have faith in my own skills from here…..)

    More to follow!

    #1305738

    Hi,

    Alright. Let us know if you need further assistance. You may need to add css rules in the css media queries to adjust the height value of the modified elements (e.g the testimonial section) on different screen sizes. The layer slider seems to have the same height on mobile and desktop view, so having the same css rule for both should be enough.

    @thinkjarvis: Thanks for the info.

    Best regards,
    Ismael

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