Can anyone help me how to add custom css file in wordpress.
I followed the below link, Where are Additional CSS files stored. But it shows only adding additional css, but i want to add css file and calling,
Thanks
Can anyone help me how to add custom css file in wordpress.
I followed the below link, Where are Additional CSS files stored. But it shows only adding additional css, but i want to add css file and calling,
Thanks
Put this code in functions.php file for add new css file (more info here).
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
function enqueue_my_styles() {
wp_enqueue_style( 'my-theme-ie', get_stylesheet_directory_uri() . "/css/ie.css");
}
get_template_directory_uri()
get_stylesheet_directory_uri()
Note: Relative CSS path must be correct.
Since you don't want to mess with the theme code/css (unless it's your own), it's best to create a child theme. Then you can put your additional CSS in the child theme's CSS file. Any CSS in there will override your parent theme's CSS.
Since you aren't changing the theme code/CSS (never a good idea), your changes will be kept when the theme has an update.
Many tutorials for creating and using a Child theme. Here's one ( a video) http://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/ ; the googles will help you find other tutorials.