-
AuthorPosts
-
August 21, 2019 at 2:20 pm #1129583
Hi!
A while ago you helped me with some text in a popup: https://kriesi.at/support/topic/simple-text-in-popup-when-clicking-a-button/.
The site we use this on still runs Enfold 4.2. When I try to update it to 4.5.7, I get the error magnificPopup is not a function, and the content that was previously in the popup is now displayed outside of the popup, on the page. I tried to fix it and I saw it was fixed here: https://kriesi.at/support/topic/magnificent-popup-not-workin-not-recognized-as-a-function/ but I cannot see what is done here exactly.
The used code:
function popup_inline() { ?> <script type="text/javascript"> jQuery(window).load(function(){ jQuery('.open-popup-link').magnificPopup({ type:'inline', midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. }); }); </script>
Can you help me with fixing this error? The site is currently back on 4.2 so there’s no error.
Thanks!
Daniel
- This topic was modified 5 years, 4 months ago by Daniel.
August 21, 2019 at 3:57 pm #1129603this is for child-theme functions.php – isn’t it?
you have forgotten some important things:function popup_inline() { ?> <script type="text/javascript"> jQuery(window).load(function(){ jQuery('.open-popup-link').magnificPopup({ type:'inline', midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. }); }); </script> <?php } add_action('wp_footer', 'popup_inline');
btw: it works in the footer as well
August 21, 2019 at 4:14 pm #1129609Hi @Guenni007,
I’m sorry, that it the code I have (yes, in the child-themes functions.php):
function popup_inline() { ?> <script type="text/javascript"> jQuery(window).load(function() { jQuery('.open-popup-link').magnificPopup({ type:'inline', midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. }); }); </script> <?php } add_action('wp_head', 'popup_inline');
- This reply was modified 5 years, 4 months ago by Daniel.
August 22, 2019 at 5:04 am #1129840Hi,
Thank you for the login & ftp access, I took a look at your site and found that you were using an old version of the header.php in your child theme.
I uploaded the updated version and new your magnificPopup works correctly and you do not have the error.
In your old header.php I didn’t see any customizations so I’m not sure why you have added it to your child theme, but you will find the file in your child theme renamed as header.php-old so if you do have customizations you will be able to get your code and move it to your new header.phpBest regards,
MikeAugust 22, 2019 at 9:34 am #1129905Hi Mike,
That indeed did the trick, thanks!
August 22, 2019 at 8:31 pm #1130084Hi,
Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Please bookmark Enfold Documentation for future reference.
Thank you for using Enfold :)Best regards,
Basilis -
AuthorPosts
- The topic ‘magnificPopup is not a function’ is closed to new replies.