Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #430617

    Hello, Guys!

    Wondered if it were possible to activate the page preloader only on the homepage?

    Thanks!
    LM

    #431319

    Hi LM2012!

    Please try adding following code to Functions.php file in Appearance > Editor

    function custom_code(){
    if(!is_home()){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.av-siteloader-wrap').removeClass('av-transition-enabled');
    });
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'custom_code');

    Best regards,
    Yigit

    #445418

    I have tried inserting the code referenced into functions.php, functions-enfold.php, and enfold-child/functions.php, but unfortunately, the preloader (including custom image preloader) seems to show on all pages. Is there another method to have the preloader show only on the ‘landing’ page?

    thanks,
    eric

    #447050

    Hi!

    the code should work. Did you clear browser cache and refresh browser a few times? I will tag Yigit to have a look again. Please kindly wait for a reply from him.

    Regards,
    Andy

    #447245

    Andy-

    should i enable the preloader in the settings? I assumed it should be unticked, but i had tried with both options, and found the same results.

    thanks for your assistance.

    eric

    #448555

    Hi,

    Open header.php and look for line 8:

    $preloader	= avia_get_option('preloader') == "preloader" ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled';
    

    Replace it by this:

    if(is_front_page()) $preloader	= avia_get_option('preloader') == "preloader" ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled';
    

    Preloader setting must be ticked.

    Regards,
    Josue

    • This reply was modified 9 years, 5 months ago by Josue.
    #448577

    I had tried the referenced code above. However, it does not seem to affect the outcome. I would just like the preloader to display only on the landing page. If a vistor comes from another page or hits the first entry page it should only be displayed. I love the preloader, but some of the staff thinks otherwise. If we can get it to only appear on the landing page, its a good compromise. :)

    thanks again,

    eric

    #448580

    Hi!

    Use this instead:

    if(is_page(23)) $preloader	= avia_get_option('preloader') == "preloader" ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled';
    

    Change 23 by the Page ID of the landing page.

    Regards,
    Josue

    #483307

    Hii,

    I want to do the same. I tried it with your last code. But it doesnt work.
    Any other idea?

    #483655

    Hi!

    Please test it again without browser cache and make sure that you’re using the correct page id. Hard refresh before testing the page.

    Best regards,
    Ismael

    #483688

    Yes youre right! I forgot to clear the browser cache! Now its working.
    Thanks!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Page Preloading only on home page?’ is closed to new replies.