I am trying to: use Types, Views, Layouts and Maps with my site.
Link to a page where the issue can be seen: hidden link
I expected to see:
Instead, I got: a problem when activating Layouts or Views. The menu, using a SuperFish based script, loses it's animation and drop-down sub menus. A slider script and div height managing script on the front page also stop working.
Both scripts are loaded by the sites theme. I corrected the use of "$" to "jQuery" in these scripts as this showed up as a problem but this didn't solve the issue. I deactivated other plugins to rule those out and still experience the issue.
Hi, can you share some information about how your custom theme enqueues jQuery and the other jQuery plugin scripts in the header?
Hi Christian, currently jQuery and other jQuery scripts in the header are written in within the theme template(s).
For the best results with Toolset, you should follow WordPress best practices for theme development. See here:
https://codex.wordpress.org/Theme_Development
WordPress encourages you to use wp_enqueue_script() to add scripts in your theme for this very reason. If you do not enqueue scripts, other plugins do not know that your theme is already loading jQuery. So if those other plugins require jQuery, they will enqueue it (following best practices). If this happens after your jQuery plugins are loaded and added to the jQuery object by your theme, they will be lost.
When you enqueue a script, WordPress knows that only one 'jquery' script should be added to the page. This prevents more than one jQuery script from being loaded into the same jQuery object, so your extensions will not be overwritten. More info about best practices to enqueue scripts:
https://developer.wordpress.org/reference/functions/wp_enqueue_script/
Hi Christian, yes it does seem the theme isn't following best practice. I will try moving the script loading as suggested and hopefully that will resolve the issue. I will mark this issue resolved in the mean time, thanks for the advice.