Home Forums Basel support forum How to create a class to disable "basel-lazy-load"

How to create a class to disable "basel-lazy-load"

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #211648

    oleg_dmitriev
    Participant

    Hi guys, your theme is very nice. However, there is a problem: when LazyLoading is enabled, when user reloads the page, icons in the Header become tiny-tiny images.

    In the “Lighting” demo, you set icons in the Headers as two “Info Box”es, in an HTML block. I use this block for my website, with changed text and icons. How can I set a class to disable these attributes: “basel-lazy-load basel-lazy-fade basel-loaded lazyloaded” for the images?

    If I replicate the image in Raw HTML, without lazy loading attributes, it does not shrink, here you can see it – the icon 1 and icon 2 are standard Info-Box (with lazy loading) and icon 3 is raw html. Icon 1 and Icon 2 shrink, Icon 3 does not shrink: https://ibb.co/nQCL2Sn

    Thanks for your help!

    #211662

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    add_action(
    	'woodmart_after_body_open',
    	function() {
    		woodmart_lazy_loading_deinit( true );
    	}
    );
    add_action(
    	'woodmart_after_header',
    	function() {
    		woodmart_lazy_loading_init();
    	}
    );

    Regards

    #211675

    oleg_dmitriev
    Participant

    Artem,
    can you please clarify the code fro Basel (not Woodmart)?

    thank you!
    Oleg

    #211679

    Artem Temos
    Keymaster

    Sorry, the code for Basel will look like that

    add_action(
    	'basel_after_body_open',
    	function() {
    		basel_lazy_loading_deinit( true );
    	}
    );
    add_action(
    	'basel_after_header',
    	function() {
    		basel_lazy_loading_init();
    	}
    );
    #211719

    oleg_dmitriev
    Participant

    Artem, thanks.
    I activated a snippet with this code, and cleared the cache – it worked fine (https://www.independent.wine/). Thanks for your help!

    Regards,
    Oleg

    #211721

    Artem Temos
    Keymaster

    Fine, we are glad that the issue is solved.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘How to create a class to disable "basel-lazy-load"’ is closed to new replies.