Tagged: homepage
-
AuthorPosts
-
April 17, 2015 at 9:03 pm #430617
Hello, Guys!
Wondered if it were possible to activate the page preloader only on the homepage?
Thanks!
LMApril 20, 2015 at 3:13 pm #431319Hi 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,
YigitMay 17, 2015 at 4:47 pm #445418I 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,
ericMay 20, 2015 at 12:01 pm #447050Hi!
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,
AndyMay 20, 2015 at 4:33 pm #447245Andy-
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
May 22, 2015 at 7:09 pm #448555Hi,
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, 6 months ago by Josue.
May 22, 2015 at 7:56 pm #448577I 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
May 22, 2015 at 7:58 pm #448580Hi!
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,
JosueAugust 5, 2015 at 1:45 pm #483307Hii,
I want to do the same. I tried it with your last code. But it doesnt work.
Any other idea?August 6, 2015 at 4:35 am #483655Hi!
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,
IsmaelAugust 6, 2015 at 6:52 am #483688Yes youre right! I forgot to clear the browser cache! Now its working.
Thanks! -
AuthorPosts
- The topic ‘Page Preloading only on home page?’ is closed to new replies.