-
AuthorPosts
-
February 16, 2022 at 6:06 pm #1340943
Found this nice function from Mike:
https://kriesi.at/support/topic/change-logo-when-scrolling-down/#post-1283669That’s exactly what I need! Unfortunately it doesn’t work on my site ;-/ What ca I do?
This is my setup:
– Enfold 4882
– WordPress 5,9
– Pasted the code into my Child Theme function.phpFebruary 17, 2022 at 5:36 am #1341050Hey frankeee,
Thank you for the inquiry.
Did you update the image URL in the script? Look for these lines in the script and adjust the image URL.
$('.logo a').find( 'img' ).attr('src', 'https://your-full-url.com/wp-content/uploads/2021/01/2nd-logo.png').css({ 'padding-top': '0px'}); } else { $('.logo a').find( 'img' ).attr('src', 'https://your-full-url.com/wp-content/uploads/2021/01/logofinale.svg').css({ 'padding-top': '15px'});Please post the site URL in the private field so that we can check the modification.
Best regards,
IsmaelFebruary 17, 2022 at 8:37 am #1341074… thank you Ismael fpr your feedback ;-)
… according to your question: Yes I did – with some dummy images – but that doesn’t matter for the function.Please see private content …
February 18, 2022 at 5:22 am #1341265Hi,
Thank you for the info.
Did you set jQuery to load in your footer? The script is not working because according to the browser console “jQuery is not defined”, which means that either jQuery is actually not loaded or the script loads before the jQuery library. To fix the issue, we adjusted the priority of the wp_footer hook to 999 to make sure that the script loads after the library.
Best regards,
IsmaelFebruary 18, 2022 at 10:32 am #1341311Ismael – it works!
Thank you very much – I wouldn’t have thought of that.February 19, 2022 at 6:35 pm #1341419Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Change logo image after scroll down’ is closed to new replies.
