Proper Way to Enqueue CSS for Front Page – template_redirect in functions.php?
Nope. Use the wp_enqueue_scripts hook directly for enqueing all styles and scripts. There’s no need to hook into template_include for that. template_include is specifically for modifying templates. //Adding and Encuing styles for Front Page add_action( ‘wp_enqueue_scripts’, ‘front_page_design’ ); function front_page_design(){ if ( is_front_page() || is_home()) { wp_enqueue_style( ‘home_page_style’, get_stylesheet_directory_uri() . ‘/index-style.css’, array(‘handle_of_main_style’) ); } } … Read more