I am trying to: load Bootstrap 3 only in my homepage because I need it for the view slider but not in the other pages. (especially that it causes other visual bug in the theme).
Is there an option to load with condition?
thanks
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
I would like to know your bootstrap load settings, from where you are loading the bootstrap - theme or plugin?
I load it from toolset settings because my theme is not made with bootstrap.
thanks
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Ok - there is no way to restrict the bootstrap if you set to load bootstrap from Toolset plugins.
Better - do not load bootstrap from Toolset and try to add bootstrap manually on your homepage.
Something like this - add following code to functions.php file of your theme:
function homepage_add_bootsrap() {
if ( is_front_page() ) {
wp_enqueue_style('bootstrap', get_template_directory_uri() . 'css/bootstrap.min.css');
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_script( 'bootstrap-js', '<em><u>hidden link</u></em>', array('jquery'), '3.3.4', true );
}
}
add_action('wp_enqueue_scripts', 'homepage_add_bootsrap');
More info:
=> https://stackoverflow.com/questions/26583978/how-to-load-bootstrap-script-and-style-in-functions-php-wordpress
=> https://stackoverflow.com/questions/26583978/how-to-load-bootstrap-script-and-style-in-functions-php-wordpress