Scripts to footer
-
Hy i’m wondering how can i move simply the <scrits> that are loads for buddypress to my footer ?
thanks in advance !
-
Why do you want to do this ? 😉
Adding js to footer maybe best practice, but is intended for heavy scripts. So be carefull before modifying buddypress. If you have load time issues or if you consider your site to slow, first trackdown the culprit. In most case, it is only because of to many or bad written plugins on a poor server.https://codex.wordpress.org/Using_Javascript
https://codex.wordpress.org/Function_Reference/wp_enqueue_scripthttp://blog.cloudfour.com/getting-all-javascript-into-the-footer-in-wordpress-not-so-fast-buster/
hi thanks for the rapid response,
so i’m a god dev on wp but i start to bp ant in wp i can put simply the script to the footer with the handlethen what i want to do is to minify and concatenate all js css then gzip it for cache and put all the string in deferer (js)
i have made it in an other web site : http://preuves-par-images.fr/
but now in an other i have buddypress who put his scripts not to the footer (wtf ??) coding dummy put the css in head and js to footer… so my simple question is hos can i put them in the footer ??
thanks in advance ! 🙂
sorry to reply this, but all answers to your query are in the links i provided.
i have buddypress who put his scripts not to the footer (wtf ??)
perhaps because BP devs consider it is not necessary ? 😉
If you think it is dummy practice or better to get anything to footer by default, open a ticket and provide some patches. Maybe you can than discuss directly with a dev around the pro and contra for footer scripts.The problem with loading scripts in the footer by default is dependency. Take jQuery for example, if WordPress were to load jQuery in the footer by default and a WordPress theme developer then loaded some jQuery-dependent code in the header or body then that jQuery-dependent code wouldn’t work. It’s these considerations the BuddyPress core developers have to make.
Thanks,
anyone know where i can have the handles of the bp scripts ?
with that i can dequeu them and enqueu again to put them in the footer
@Henrywright :
For jquery is loaded by default in the footer but if it detect a script in wp_head() he print it in the head that way there is never a bug.bp put his script to the head or it’s not define at all where to put them, so wp prin at first jquery then the bp scripts
- The topic ‘Scripts to footer’ is closed to new replies.