Site logo

[Support request] Generate Press Hooks + Elementor Shortcodes Styling

Home Forums Support [Support request] Generate Press Hooks + Elementor Shortcodes Styling

Home Forums Support Generate Press Hooks + Elementor Shortcodes Styling

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #2265125
    GeneratePressUser

    Hello, So we made our some theme templates with Elementor but this had 1 big disadvantage we lost the control on implementing hooks within that Elementor area, only we were able to implement hooks above and below the elementor area, so important places like after product title, after add to cart button on single page etc were not possible to be accessed via hook coz elementor was having control of that.

    So, after thinking on it we disabled the elementor template on our single product pages, so we would like to get a bit help on styling it like our elementor page, we did almost all other things just a little is left which we believe your team can help.

    More info in the private box, Thanks!

    #2265137
    GeneratePressUser

    Adding up to my previous response, pls check private box

    #2265160
    GeneratePressUser

    It seems the CLS score and all is affected a lot after enabling.

    Score on using just elementor: https://prnt.sc/L5bsI0zNeoWu

    Score after using generatepress + generatepress hooks with elementor shortcodes: https://prnt.sc/MQQFkgr-A2b-

    Any idea on how can that be solved or will that always be an issue if we are using it like that?

    #2265341
    Fernando
    Customer Support

    Hello there,

    Starting with the styling, here’s some CSS code you may try adding in Appearance > Customize > Additional CSS:

    .single-product .woocommerce-product-gallery__image.flex-active-slide {
        border: 5px solid #4f4f4f;
    }
    
    .single-product .woocommerce-product-gallery .flex-viewport {
        height: fit-content !important;
    }
    
    .single-product ol.flex-control-nav.flex-control-thumbs > li >img {
        border: 5px solid #4f4f4f;
    }
    
    .single-product .summary.entry-summary.single-product .summary.entry-summary h1.product_title.entry-title {
        margin-bottom: 20px;
    }
    
    .single-product .summary.entry-summary p.price {
        text-align: center;
    }
    
    table.variations .value {
        border-radius: 5px;
    }

    For the sale label, may you provide a link to a single product which is on sale?

    Moreover, with regards to the CLS, part of the issue seems to stem from the Header, and how it’s loaded: [removed as requested by customer]

    As shown, it’s loaded late, and it’s pushing down the elements. Are you using a caching/optimization plugin? Can you try adding a Header through a Block Element to see the difference?

    Side note, WooCommerce has these hooks available for the single product page: https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/

    Hope to hear from you soon.

    #2266116
    GeneratePressUser

    Hey Fernando,

    I have put that product on sale so you can see it.

    Regarding CLS, I am using caching plugin but how can elementor page show things properly without CLS while when elementor shortcode is being used with generatepress hooks that has CLS issue?

    #2266372
    Fernando
    Customer Support

    For the CSS code with regards to the sale notice, here’s something you may try:

    .single-product span.onsale {
        position:absolute;
        top: 0;
        left:0;
        border-radius: 10px;
        padding: 15px 20px 15px 20px;
        margin: -10px 0px 0px -5px;
    }

    With regards to the CLS, it’s odd. The Shipping information also shows up opened when the page is loaded, when hooked. Are you using different elements for this? The Elementor page seems to use something called Toggle and the other page is using an Accordion. If they are different, can you try using a toggle block as well to see the difference?

    Can you also try temporarily disabling caching/optimization plugins like Jetpack?

    Kindly let us know how it goes.

    #2267197
    GeneratePressUser

    Hey Fernando,

    Actually accordion of elementor shows by default open when page loads so instead of using a script to close it, we have now replaced it with toggle totally which is by default closed.

    Regarding Jetpack do you think it does caching or optimisation? coz I don’t feel like it does that, can you once check it now, if you can find anything.

    #2267454
    Fernando
    Customer Support

    I see.

    It’s not apparent why the header is loading the way it is right now when hooked.

    We’ve had customers before have similar issues, and the cause was an optimization/caching plugin.

    You could try temporarily disabling it, and the test in https://pagespeed.web.dev/ if the CLS goes away.

    If not, kindly let us know.

    #2269516
    GeneratePressUser

    Hey Fernando,

    I have disabled the caching plugin and still it seems to be showing CLS.

    #2269549
    Ying
    Staff
    Customer Support

    The hook you are using in GP to enter the shortcode is generate_after_header?

    If that’s the case, this section has been added to a different location in terms of HTML structure.

    It’s within the content area on the elementor page, but before the content area on the GP page, the structure difference seems the cause of CLS.

    Try using generate_inside_container hook.

    #2269552
    GeneratePressUser

    Hey Ying,

    That does not put it at a proper place, pls see the link in the private box

    #2271427
    GeneratePressUser

    Hey Ying,

    Did you manage to check it?

    #2271664
    David
    Staff
    Customer Support

    Hi there,

    that hook, won’t be full width.
    You would need to use the original after_header hook and then figure out why the CSS is loading late to fix the CLS issue.

    Or alternatively create the hero using a GP Block Element

    #2272100
    GeneratePressUser

    Hey David,

    Ok after_header puts it in proper position, but still the CLS is showing bad, like the score is going bad, do you have any idea why CSS is loading late? Is this a common problem with using Elementor shortcodes? I remember you telling me that using things like this won’t have any difference as such noticeable,

    #2272493
    David
    Staff
    Customer Support

    It looks like you’re loading Elementor stylesheets in the Foot of your site.
    Which means they will get applied after the site is loaded, which cause CLS.

    You should check with Elementor support as to why that happens.

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