Tagged: functions.php, Lightbox, popup
-
AuthorPosts
-
October 4, 2018 at 9:26 am #1017776
Hello Team,
This is a reoccurring issue (#978817) which was previously solved by Mike.
The code line Read More… is used in several pages such as:http://ilanwittenberg.com/faces-of-jerusalem
http://ilanwittenberg.com/tunnel-beach-dunedin/I am not sure what caused the code to break, perhaps an update to Enfold. Mike successfully resolved the problem by adding the code below to functions.php:
/*wp_enqueue_script( 'avia-popup', $template_url.'/wp-content/themes/enfold-child/js/jquery.magnific-popup.js', array('jquery'), 2, true);*/ wp_register_script( 'custom-js', $template_url.'/wp-content/themes/enfold-child/js/custom-js.js', 'jquery', "1", true); wp_enqueue_script( 'custom-js' ); function gallery_more_info(){ ?> <script> jQuery(window).load(function(){ jQuery('.gallery-more-info-link').magnificPopup({ type:'inline', midClick: true }); }); </script> <?php } add_action('wp_footer', 'gallery_more_info');
Happy to grant admin rights if required.
Please advise,
ofekwOctober 6, 2018 at 8:20 pm #1018559Hey ofekw,
Sorry for the late reply, I see your page has the errorjQuery is not defined
Please try disabling your plugins to be sure it’s not a conflict, if that doesn’t help please include a admin login in the private content area so we can take a closer look.
I suspect that the jQuery is not loading in the head like it needs to.Best regards,
MikeOctober 6, 2018 at 10:14 pm #1018568Hello Mike,
Thanks for following up.
Disabled Autoptimize plugin (optimises website’s performance: JS, CSS, HTML, images, Google Fonts, etc) and that solved the issue.
Is there an alternative optimising plugin that you can recommend testing?
Regards,
ofekOctober 6, 2018 at 10:24 pm #1018570Hi,
That’s good news, try using it without minifying js, that’s what typically breaks jQuery
I believe there is a setting to disable js minifying.Best regards,
MikeOctober 6, 2018 at 10:39 pm #1018574Hello Mike,
Here are Autoptimize JavaScript Options:
Optimise JavaScript Code?
Aggregate JS-files?
[Aggregate all linked JS-files to have them loaded non-render blocking? If this option is off, the individual JS-files will remain in place but will be minified.]
Also aggregate inline JS?
[Let Autoptimize also extract JS from the HTML. Warning: this can make Autoptimize’s cache size grow quickly, so only enable this if you know what you’re doing.]
Force JavaScript in <head>?
[Load JavaScript early, this can potentially fix some JS-errors, but makes the JS render blocking.]
Exclude scripts from Autoptimize:
[s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,seal.js, A comma-separated list of scripts you want to exclude from being optimised, for example ‘whatever.js, another.js’ (without the quotes) to exclude those scripts from being aggregated by Autoptimize.]
Add try-catch wrapping?
[If your scripts break because of a JS-error, you might want to try this.]Enabled Force JavaScript in <head> ; and that solved the issue but disabled the transition from the home page slider to the portfolio!
Should I try excluding a script? What is the script name? (Tried more-info,gallery-more-info-link,gallery_more_info without success).
Thanks,
ofekw- This reply was modified 6 years, 1 month ago by ofekw.
October 6, 2018 at 11:30 pm #1018583Hi,
Please try to not “Optimise JavaScript Code” I take this as the same as minifying
Enfold combines all of it’s JS into a single file dynamically depending on the elements used.
Please see our post on this.If you are done creating your site and are ready to make it as fast as it can be, then please read this post
Best regards,
MikeOctober 7, 2018 at 1:19 am #1018587Thanks Mike!
Much appreciated support,
ofekwOctober 7, 2018 at 3:23 pm #1018659Hi,
Glad to help, unless there is anything else we can help with on this issue, shall we close this then?Best regards,
MikeOctober 7, 2018 at 8:33 pm #1018696Hello Mike
Yes, Issue resolved and have implemented most of the optimisation tips.
Kind regards,
ofekw
October 7, 2018 at 9:25 pm #1018699Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Lightbox Popup fails’ is closed to new replies.