- This topic has 11 replies, 4 voices, and was last updated 1 year, 6 months ago by
Elvin.
-
AuthorPosts
-
January 15, 2021 at 9:44 am #1620367
Jeff
Hi folks, I’ve read some posts that only the sticky requires javascript, but I’m having some trouble getting rid of a few remnants:
– Sticky is turned off
– Do have Menu Plus enabled, no other premium items besides elements
– javascript being loaded:~~~
/wp-content/plugins/gp-premium/menu-plus/functions/js/sticky.min.js?ver=1.12.3
/wp-content/themes/generatepress/assets/js/navigation-search.min.js?ver=3.0.2
/wp-content/themes/generatepress/assets/js/dropdown-click.min.js?ver=3.0.2
/wp-includes/js/jquery/jquery.min.js?ver=3.5.1
/wp-content/themes/generatepress/assets/js/main.min.js?ver=3.0.2
~~~Any way I can get rid of any/all of these?
January 15, 2021 at 11:33 am #1620486Leo
StaffCustomer SupportHi Jeff,
I think you are confusing jQeury with Javascript.
GP only uses jQuery if the sticky navigation or blog masonry options are activated – we are working to replace those with vanillla JS.
Take a look at Elvin’s answer here is you need to remove them:
https://generatepress.com/forums/topic/how-to-remove-javascript/#post-1557185Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 15, 2021 at 4:46 pm #1620689Jeff
Hello, the sticky is turned off, so how can I get rid of the sticky javascript?
How can I get rid of all these javascripts?~~~
/wp-content/plugins/gp-premium/menu-plus/functions/js/sticky.min.js?ver=1.12.3
/wp-content/themes/generatepress/assets/js/navigation-search.min.js?ver=3.0.2
/wp-content/themes/generatepress/assets/js/dropdown-click.min.js?ver=3.0.2
/wp-content/themes/generatepress/assets/js/main.min.js?ver=3.0.2
~~~And how can I stop loading jquery?
I have zero plugins loading jquery. Is all of this loading because of Menu Plus?
January 16, 2021 at 4:59 am #1621104David
StaffCustomer SupportHi there,
can you share a link to your site where we can see these scripts being requested ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 16, 2021 at 6:34 am #1621162Jeff
Site: https://www.ufafun88.com
I see these scripts loaded when seeing the waterfall of resource loading using gtmetrix.com
January 16, 2021 at 8:29 am #1621454David
StaffCustomer SupportYou have the Mobile Sticky Header and Navigation Search enabled….
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 17, 2021 at 9:50 am #1622599Jeff
Ah, I had Sticky Navigation: Off, but in the Header it was still turned on. I’ve turned that off. It looks like jquery is no longer loading when that is turned off. Fantastic!
I see where I can turn Search off.
The only questions I have are how to get these two turned off?
/wp-content/themes/generatepress/assets/js/dropdown-click.min.js?ver=3.0.2 /wp-content/themes/generatepress/assets/js/main.min.js?ver=3.0.2
January 17, 2021 at 4:51 pm #1622835Elvin
StaffCustomer SupportHi there,
/wp-content/themes/generatepress/assets/js/dropdown-click.min.js?ver=3.0.2
/wp-content/themes/generatepress/assets/js/main.min.js?ver=3.0.2If you wish to remove them from being queued, you can try adding these.
add_action( 'wp_enqueue_scripts', 'tu_remove_menu_scripts', 50 ); function tu_remove_menu_scripts() { wp_dequeue_script('generate-dropdown-click'); wp_dequeue_script('generate-main'); }
Reminder: Dropdown-click script is used when you have “click” or “click arrow” enabled on your customizer’s menu settings. Removing it may cause issues.
A wise man once said:
"Have you cleared your cache?"January 17, 2021 at 6:56 pm #1622882Jeff
Great! I changed to “hover” on the customizer’s menu settings, and the generate-dropdown-click script went away.
I can manually remove generate-main as you suggest. But is there anything I need it for? Is it always queued by default in GeneratePress regardless?
January 17, 2021 at 8:26 pm #1622933Elvin
StaffCustomer SupportI can manually remove generate-main as you suggest. But is there anything I need it for? Is it always queued by default in GeneratePress regardless?
It is used by the theme for toggling things as well. Some lines in the script are being used for the navigation menu’s tablet view.
Here’s the readable view.
https://github.com/tomusborne/generatepress/blob/master/assets/js/main.jsA wise man once said:
"Have you cleared your cache?"January 18, 2021 at 1:01 am #1623118Jeff
The mobile menu doesn’t work at all with generate-main disabled. I’ve re-enabled it, as it is a small price to pay for mobile menu support, until I take the time to figure out a workaround.
Thanks!
January 18, 2021 at 3:48 pm #1624267Elvin
StaffCustomer SupportNo problem. 🙂
A wise man once said:
"Have you cleared your cache?" -
AuthorPosts
- You must be logged in to reply to this topic.