Created
June 6, 2017 09:56
-
-
Save rintoug/8f7b72e442cc3b3297ee285a6970623e to your computer and use it in GitHub Desktop.
Adding CSS to WordPress Theme Via functions.php File
This file contains hidden or 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
<?php | |
// Load the theme stylesheets | |
function active_theme_styles() | |
{ | |
// Load all of the styles that need to appear on all pages | |
wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/css/custom.css' ); | |
// Conditionally load some thing in the home page | |
wp_register_style( 'slideshow', get_stylesheet_directory_uri() . '/css/slideshow.css' ); | |
if(is_page('home')) { | |
wp_enqueue_style('slideshow'); | |
} | |
} | |
add_action('wp_enqueue_scripts', 'active_theme_styles'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment