I’m having trouble getting the second argument in wp_enque_style. Here’s how my site is setup:
- style.css
- custom_style.css
- index.php
In a template, I have this code:
$stylesheet_url = bloginfo('template_directory') . '/custom_style.css';
wp_enqueue_style( 'custom_style', $stylesheet_url );
Which isn’t working. Any reasons why?
The output is just the path to my template directory, outputted as raw text, which is obviously not the correct behavior.
To enqueue extra styles you should place the following code in your functions.php
use get_bloginfo instead, which returns the value instead of directly echoing it.