I am trying to enqueue Bootstrap's CSS only on two pages.
Here's the code I have in my functions.php
file:
function bootstrap_css() {
if (is_page('who-we-are-2') || is_front_page()) {
wp_enqueue_style('bootstrapstyle', '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
}
}
add_action('wp_enqueue_scripts', 'bootstrap_css');
From other StackExchange questions and Googling, that code should work. It works for the home page, but not on the "who-we-are-2" page. What's odd is is_page('who-we-are-2')
doesn't work by itself. I have also tried is_page(32365)
and is_page('32365')
, 32365 being the page ID to no avail.
Any help would be greatly appreciated!