Here is the code for how to do this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|// Load the theme stylesheets|
|// Example of loading a jQuery slideshow plugin just on the homepage|
|wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' );|
|// Load all of the styles that need to appear on all pages|
|wp_enqueue_style( 'main', get_template_directory_uri() . '/style.css' );|
|wp_enqueue_style( 'custom', get_template_directory_uri() . '/css/custom.css' );|
|// Conditionally load the FlexSlider CSS on the homepage|
I’m a fan of the Flexslider Slideshow Plugin from WooThemes, so that’s what I’m setting up to link to just on the homepage.
The required stye.css and a custom CSS stylesheet inside of a css directory in the themes folder are being queued up inside the theme_styles() function and then loaded to execute and output into the header via the wp_head() function that should be included in the header.php file before the closing of the <head> tag.
For another read on this, check out this TutsPlus post on the topic.