• Resolved woorooo

    (@woorooo)


    Hi,

    Is there a way to skip lazy loading of the maps on archives, search and location pages?
    There is a certain conflict between this option and Listimia theme when the map is hidden on mobile. Unfortunately theme developer said that he can do nothing about it and advised to see if there is a way to disable certain maps from lazy loading.

    Thank you,

    Roman.

    • This topic was modified 3 years, 7 months ago by woorooo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @woorooo,

    You can disable lazy load map on certain pages via hook.

    Try this PHP snippet.

    function gd_snippet_210503_disable_lazy_load_map( $lazy_load ) {
    	if ( geodir_is_page( 'location' ) || geodir_is_page( 'search' ) || geodir_is_page( 'archive' ) ) {
    		$lazy_load = ''; // Disable lazy load map
    	}
    
    	return $lazy_load;
    }
    add_filter( 'geodir_lazy_load_map', 'gd_snippet_210503_disable_lazy_load_map', 11, 1 );

    Regards,
    Kiran

    Thread Starter woorooo

    (@woorooo)

    Worked like magic, thank you @kprajapatii ??

    • This reply was modified 3 years, 7 months ago by woorooo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Skip map lazy load on certain page types’ is closed to new replies.