Custom theme – Bootstrap CSS not loading via wp_enqueue_style
-
I’m designing a custom Theme using the underscores.me template. I’ve read several different “my css doesn’t load” threads here, but none seem to help w/ my issue. My own styles will load via
wp_get_template_directory_uri().'/style.css', while– even withbootstrap.min.cssetc stored locally (e.g. ./css/bootstrap.min.css), wherewp_get_template_directory_uri().'/css/bootstrap.css'would be used in the code, and does show in view browser source– it’s still not loading as evidenced in Chrome developer tools sources.If i use Chrome dev’r tools to view source, and click the
<link href="whatever_file" />, the file opens. So, it’s not a matter of my paths being incorrect.If I hard code my html as an HTML file, the styles are loaded. Hybrids of html / php also load the CSS. But, when I try to go “by the book” for theme development, it doesn’t load.
If I use the ‘Additional CSS’ option in the customizer, and use e.g.
@import url('http://site.local/wp-content/themes/theme_name/css/bootstrap.min.css');it does in fact render the page w/ the bootstrap CSS as desired, but that doesn’t seem correct to me. What might I be doing wrong here?
The topic ‘Custom theme – Bootstrap CSS not loading via wp_enqueue_style’ is closed to new replies.