- This topic has 3 replies, 2 voices, and was last updated 8 years ago by
Tom.
-
AuthorPosts
-
March 26, 2018 at 12:04 pm #531503
Mike
Since I use a separate menu plugin (Max Mega Menu), can I assume that I no longer need the menu related js files enqueued by GP:
menu.min.js
dropdown.min.jsIf so, could you please kindly post the PHP snippets to dequeue these scripts?
Also I use the Sections module, but do not use the parallax feature, is it safe to also dequeue:
parallax.min.js
And if so, could you please also provide the code?
Finally, what is a11y.min.js for? Is it safe to be dequeued as well?
Thanks!
March 26, 2018 at 8:45 pm #531910Tom
Lead DeveloperLead DeveloperHi there,
If you’re not using the GP menu at all (not even on mobile), then you safely dequeue those files:
add_action( 'wp_enqueue_scripts', 'tu_remove_menu_scripts', 50 ); function tu_remove_menu_scripts() { wp_dequeue_script( 'generate-menu' ); wp_dequeue_script( 'generate-dropdown' ); }The parallax script will only enqueue if parallax is turned on within a Section.
a11y.js is required for people with disabilities. It allows them to navigate your site successfully. I highly suggest you keep it.
March 26, 2018 at 11:29 pm #532013Mike
Hi Tom,
Thanks a lot for your prompt response. I was able to dequeue the menu scripts as you instructed; however, the parallax.min.js was still loaded for my site even though all my sections had parallax set to “Disabled”. Upon taking a look at the plugin’s PHP file, I was able to infer that the name of the parallax enqueue script is generate-sections-parallax, so I added:
wp_dequeue_script( 'generate-sections-parallax');to the codes you gave me, and it worked to get rid of parallax.min.js for me.
Thanks again.
P.S. I’m so happy that I found this great theme. IMO this theme literally should be WordPress’s default starting theme (instead of those Twenty xx every year…). It is just about everything a framework needs to be, and nothing it shouldn’t be. The more I use it, the more it amazes me how well-thought of everything is in this theme. I think you and everyone using this theme should pitch the idea to WP haha.
March 26, 2018 at 11:31 pm #532016Tom
Lead DeveloperLead DeveloperThank you so much for the kind words! I really appreciate it!
I’m glad you got everything working as you need it 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.