Tagged: LifterLMS, WordPress 5.0
-
AuthorPosts
-
January 30, 2019 at 6:33 pm #1060579
This issue was resolved with a hack, however it’s back: The “LifterLMS” plugin works with every other theme except Enfold
Here is a reply from Developers, I did all they asked yet there was no solution found.
Please do let me know if access is needed
—–From Dev ————–
Hi there,
I checked this and for some reason the javascript file that powers the quizzes is not loaded on the site at all. I’m not sure why that is unless something’s deliberately dequeued the quiz js since there are no 404s that I can see. The file is also present where it is expected: https://ver2.wpatrainingdev.com/wp-content/plugins/lifterlms/assets/js/llms-quiz.min.js
Without this script, the quiz button does nothing except reload the page which is what you’re experiencing right now.
Could you or your developer check if there’s something on the site that could be causing this? It could be one of the plugins that’s not configured correctly. You could use a plugin like this one to find the culprit: https://wordpress.org/plugins/plugin-detective/
If there’s something that’s obviously different between this site and the main one, that would be the place to start.
I hope this helps. Do let me know if you need more information or help with this.
Best
February 1, 2019 at 7:03 pm #1061674Hey vidordesigns,
Enfold does not block other plugins scripts. Have you tried the plugin suggested above and what are your findings?
Best regards,
VictoriaFebruary 1, 2019 at 8:46 pm #1061710Hi Victoria, thank you for the response. I have tried a bunch of things. We have 3 staging sites [Prod, Dev, and Ver2] The environment I instaled Enfold is Ver2 –
The Enfold theme is the only theme where these particular scripts do not load..I have tested with many other themes. They all work fine. see image below.
https://vidordesigns.imgur.com/all
Through all my meanderings, I found that these two scripts are not being queued in Enfold, So I had to add manually in the footer. However that is very bad to do as we know.
<!– added LIFTERLMS QUIZ javascript manually –>
<!– <script src=”https://wpatrainingdev.com/wp-content/plugins/lifterlms/assets/js/llms-quiz.min.js?ver=3.24.3″ type=”text/javascript”></script>
<script src=”https://wpatrainingdev.com/wp-content/plugins/lifterlms-advanced-quizzes/assets/js/llms-aq.js?ver=1.0.4″ type=”text/javascript”></script> –>Again – Any other theme, will work fine.
Thank you!
February 3, 2019 at 5:40 pm #1062302Hi vidordesigns,
You can use the wp_enqueue_script function to enqueue the missing scripts, it will be a cleaner solution
Here is a snippet used for the other script but can be adjusted
https://gist.github.com/johnbuck/6277503Best regards,
VictoriaFebruary 4, 2019 at 9:12 pm #1062855I appreciate that Victoria, My Question is..Why don’tt the scripts load in the Enfold theme, but load in any other theme?
All other themes
Enfold
Also where is the wp_enqueue_script?
– I don’t see it anywhere in Functions.phpFebruary 6, 2019 at 3:19 am #1063432Here is another image using Query Monitor. Notice the 2 scripts are not being called.
I am puzzled that any other theme works but Enfold.
February 11, 2019 at 7:52 am #1065337Hi,
I appreciate that Victoria, My Question is..Why don’tt the scripts load in the Enfold theme, but load in any other theme?
It is possible that the scripts’ dependencies are being conditionally loaded by the theme. The theme has this feature where it only loads scripts that are actually used in the page, so one of those dependencies may be missing. Please ask the plugin author which dependencies are missing when they check your page. For now, you can use the wp_enqueue script or just leave the scripts in the footer, but we do recommend doing the former.
Best regards,
IsmaelFebruary 11, 2019 at 6:52 pm #1065607Ismael thanks for jumping back on, I appreciate it man. I think I got it. I REALLY want to know why this happened in detail. Is there a reason why Posts don’t load certain scripts?
Here is what I have – Does it look good to you? The first JS is not loading; Thanks again!
// Manually load LifterLMS quiz javascript
add_action(‘wp_enqueue_scripts’, ‘enqueue_lifter_Quiz_Manually’);
function enqueue_lifter_Quiz_Manually() {
wp_enqueue_script(
‘lifterQuizManually’,
plugin_dir_url(‘lifter’).’/lifterlms/assets/js/llms-quiz.js?ver=3.28.1′
);
wp_enqueue_script(
‘lifterQuizManually’,
plugin_dir_url(‘lifter’).’/lifterlms-advanced-quizzes/assets/js/llms-aq.js?ver=1.0.9′
);
}February 12, 2019 at 12:56 pm #1065933Hi,
According to the Query Monitor results seen on your screenshots, the scripts have missing dependencies so they’re not being loaded properly. Again, the theme loads certain scripts conditionally, so it’s possible that one of those scripts is a dependency, which is not present because it doesn’t meet certain conditions required by the theme.
Yes, that snippet looks good and valid.
Best regards,
IsmaelFebruary 13, 2019 at 2:08 am #1066172Thanks! Please close ticket. I do think it will come up again. What would be the bet way to reopen a case?
February 13, 2019 at 4:29 am #1066212Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Latest Enfold [5.+] not installing Javascript for LifterLMS plugin’ is closed to new replies.