Replies: 5 comments 5 replies
-
|
Hey Karsten, I see you're looking at the 4.2 documentation of bootstrap. Bootscore is already up to 5.2 (https://getbootstrap.com/docs/5.2/getting-started/introduction/) which doesn't need jQuery anymore. But if you want to, we still load jQuery. It's provided by WordPress so that's why you can't find it in the bootScore files. On the line below in Line 269 in d18b916 Just a heads-up from the jQuery that WordPress loads: it's always loaded in noConflict mode (jQuery docs), meaning that Line 5 in d18b916 |
Beta Was this translation helpful? Give feedback.
-
|
Thanks!! Got it. |
Beta Was this translation helpful? Give feedback.
-
|
Hi: I am trying not to load jquery unless necessary. It seems that bootscore/assets/js/theme.js triggers the jquery (2 files to load) but if I dequeue this file in my chid, jquery does not load in my current configuration, but I don't know if this code is needed. So I was thinking that if we need this file bootscore/assets/js/theme.js mabe it could be written in vanilla js, is that possible to be added in the parent for the next version? I just did a test in my child and dequeued bootscore/assets/js/theme.js and added its vanilla js code in child/assest/js/custom.js but still loads jquery. But then I removed jquery dependency like this: wp_enqueue_script('custom-js', $child . '/assets/js/custom.js', array('jquery'), $modificated_CustomJS, true); changed the array('jquery') to: array() and it worked! Is this the correct way?... sorry currently learning Bootscore. Thank you. Daniel. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Daniel, jQuery is loaded by WordPress, not by us. So you need something like this to dequeue: /**
* Dequeue jQuery
*/
add_action('wp_enqueue_scripts', function () {
if ( ! is_admin() ) {
wp_deregister_script('jquery');
wp_deregister_script('jquery-core');
wp_deregister_script('jquery-migrate');
wp_dequeue_script('jquery');
wp_dequeue_script('jquery-core');
wp_dequeue_script('jquery-migrate');
}
}, 100);However, this is dangerous because jQuery is used by so many plugins.
We have this already here #565. But, while changing the
So, going the vanilla way, all this files must be translated, which is a hard job. There must be a person who is able and willing to do that and maintain this in the long-term. I am not think it's that worth because jQuery is easy to read and used by nearly all WP plugins/themes. |
Beta Was this translation helpful? Give feedback.
-
|
Hi: Thank you for your reply. Yes Wordpress loads jquery when this file is loaded, so my question is, what is this file for? Is it needed? Is there a place where I can see info about this file?: bootscore/assets/js/theme.js If it is needed I already have vanilla js (is done by chatgpt tho) so I could place it in my child, is it here maybe a good place?: child/assest/js/custom.js I wouldn't dequeue jquery as is maybe used for other plugins in the future. Thank you. Daniel. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Some of the bootstrap functions need jquery , but jquery is not (no longer) incorporated into the bootstrap-lib / packages. (https://getbootstrap.com/docs/4.2/getting-started/introduction/) From this I derive, that the theme developer has to integrate jquery for getting the complete bootstrap service.
Bootscore is the theme for bootstrap. I just tried to find the jquery lib itself in bootscore-main and grepped each file for a respective download command - without any success.
What is the position of bootscore: Is it the task of the bootscore.child developer to integrate jquery in his theme or did I overread something?
Many thanks for your work - again and again: It is very helpful to have a mother theme for which all the work is already done that one normally has to do by oneself if one wants to set up a bootstrap based wordpress instance.
KR
Beta Was this translation helpful? Give feedback.
All reactions