Tagged: enfold
-
AuthorPosts
-
June 6, 2018 at 2:30 pm #967861
Hi I have updated some web sites with last Enfold version. In all of them I activated the Magnificent Popup with the following snippet in 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 }
Everything works fine except for one site in which the window that should be hidden unless one clicks on the link is actually opened. Any clues?
Thanks
June 9, 2018 at 6:43 pm #970490Hey Elena,
The snippet above is not complete, please ensure your snippet contains the last line like this:function popup_inline() { ?> <script type="text/javascript"> jQuery(window).load(function(){ jQuery('.open-popup-link').magnificPopup({ type:'inline', midClick: true }); }); </script> <?php } add_action('wp_head', 'popup_inline');
If you do have the full snippet, and your console is giving the error “not recognized as a function” this could also be a js conflict, Try disabling your plugins. If that resolves the issue, reactivate each one individually until you find the cause.
If this doesn’t solve and your popup box is showing when it should be hidden, please ensure the hidden div contains the class “mfp-hide”
If none of this helps, please include a admin login in the private content area so we can take a closer look.Best regards,
MikeJune 11, 2018 at 6:27 pm #971332Hi Mike, excuse me but I actually added also the line
add_action('wp_head', 'popup_inline');
I just forgot to paste it in my previous msg.
However it doesn’t work. In reality it always worked and messed up after an update. So I am pretty sure that both the snippet in the funcrions.php file and the snippet in the html code is ok.
I will try to disable the plugins and see if something changes. Otherwise I will send you an access to the site.
Thank you very much
June 12, 2018 at 4:51 am #971502June 13, 2018 at 4:58 pm #972367Hi Mike, no way: the problem is still there. The popup modal is on the pages of some products. I add in a private section the access to the web site and one example page (a product) where the problem exists.
Also I noticed that in product pages the main menu (that should be sticky at the top) has a transparent space above it. As it is detached from the very top of the screen, which is quite annoying.If you could help me I would appreciate it very much
Thanks
- This reply was modified 6 years, 6 months ago by elenapoliti.
June 14, 2018 at 2:12 pm #972817Hi,
I see your [jQuery(…).magnificPopup is not a function] error.
Please check the file & folder permissions at: \wp-content\themes\enfold\js\aviapopup\
this is where the magnificPopup script is, it is used for many enfold popups such as the cookie notice.
Perhaps try to re-upload the scripts in the folder.
I tested your popup function and the popup code on my localhost, so they are fine.
You said this happened after you updated, did you update via FTP?
If so did you remove the enfold theme folder first, or did you try to overwrite the folder? This will cause issues.Best regards,
MikeJune 15, 2018 at 10:55 am #973225Hi Mike I did try to cancel completely the enfold folder files and copy the new version via FTP, but still the problem remains.
Actually the funny things is that I did the same with other three web sites and everything went well: the popup function worked and nothing broke.
I am working abroad for a month and I don’t have with me a local copy of the web site, so I cannot test it locally in a quick way (I should duplicate the whole web site and download it locally but it would take quite a long). Nothing you could do from your side to help me?
Thanks
June 15, 2018 at 12:20 pm #973271Hi,
Please include FTP access in the Private Content area, so we can take a closer look.Best regards,
MikeJune 15, 2018 at 1:10 pm #973284Here they are! Thanks
June 15, 2018 at 1:51 pm #973301Hi elenapoliti,
Now the JavaScript is loaded only when required, I guess magnificPopup is not loading for the products and so you need to load it explicitly.
If you need further assistance please let us know.
Best regards,
VictoriaJune 15, 2018 at 2:41 pm #973334Could you please suggest me how could I load it explicitly?
ThanksJune 16, 2018 at 9:11 pm #973754Hi elenapoliti,
I added the code, please check if the page is working properly.
Best regards,
VictoriaJune 20, 2018 at 4:49 pm #975381Sorry Victoria for answering only now. Unfortunately it still doesn’t work.
June 22, 2018 at 6:16 am #976095Hi,
Thanks for the update.
We added the magnific popup style to the queue along with the needed scripts and created another hook to separate the internal script so it loads when the required files are available. It should work properly now.
Best regards,
IsmaelJune 23, 2018 at 8:41 am #976851Thanks Ismael, now finally it work perfectly and smoothly!!!
Such a great team you are!
June 23, 2018 at 12:18 pm #976916Hi,
unless there is anything else we can help with, shall we close this then?Best regards,
MikeApril 30, 2019 at 5:23 pm #1095821@Victoria what is the code block that you inserted to load magnificPopup explicitly?
May 3, 2019 at 1:33 am #1096665Hi,
@smartstartinc: I actually forgot what we did here. What is the issue that you have with the lightbox script? Please create your own ticket and provide the site url in the private field so that we can inspect the issue.Best regards,
IsmaelMay 3, 2019 at 6:01 am #1096731No worries.
-
AuthorPosts
- The topic ‘Magnificent Popup not workin (not recognized as a function)’ is closed to new replies.