Is there a way for me to properly load my custom CSS in Wordpress so that the dynamically inputted content on my pages matches the styling of my header and footer?
In my functions.php file, I currently have the following code, but it only prints the code at the top of my theme template in HTML without applying the styles:
function custom_style() {
if ( is_page_template( 'templates/home.php' ) ) {
wp_enqueue_style( 'home', get_stylesheet_directory_uri() . '/styles.css' );
}
}
add_action( 'wp_enqueue_scripts', 'custom_style' );
I am trying to figure out how to ensure that each page displays with the same CSS as the header and footer. Can anyone provide guidance on what steps I need to take?