I was just going through this tutorial HERE and basically the author recommends that the css stylesheet be imported like so:
function theme_enqueue_styles() {
wp_register_style( 'custom-style', get_template_directory_uri() . '/style.css', array(), '20120208', 'all' );
wp_enqueue_style('custom-style' );
}
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
My header.php of my theme looks like so:
<!doctype html>
<html <?php language_attributes(); ?> >
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title><?php bloginfo('name'); ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<h1><a href="<?php echo home_url(); ?>"></a><?php bloginfo('name'); ?></h1>
<h5><?php bloginfo('description'); ?></h5>
</header>
But i am still not seeing the effect of my stylesheet , can anybody point me to what exactly am i doing wrong ?
EDIT:: On further inspection i found out that if i post the contents of header.php in index.php the stylesheet is loading fine , which means that my functions.php files is working fine. So i guess the problem is with my header.php file, I have updated above what my header.php file looks like, so can somebody tell me whats wrong with my header.php file now ?
Thank you.
It should be:
The style.css is in your root folder of the theme, am I right?
The problem is i was’t importing the header like so: