Skip to content

Instantly share code, notes, and snippets.

@smileBeda
Created December 9, 2020 12:40
Show Gist options
  • Save smileBeda/c0062fd81d8175354603f351a9758a94 to your computer and use it in GitHub Desktop.
Save smileBeda/c0062fd81d8175354603f351a9758a94 to your computer and use it in GitHub Desktop.
add_action( 'wp_enqueue_scripts', 'conditionally_enqueue_styles');
function conditionally_enqueue_styles() {
if ( is_front_page() || !is_archive() ) {
wp_enqueue_style('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_script( 'bootstrap-js', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js', array('jquery'), '3.3.4', true );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment