wordpress functions.php is displaying nothing for CSS

I am new to wordpress custom theme design. I am trying to access the CSS via functions.php
Unfortunately I wrote the php code but when I run it, it display blank screen and all my content are not displaying.
The code is here.

<?php
function nanoweb_resources() {
    wp_enqueue_style('style', get_stylesheet_uri());
}
add_action( 'wp_enqueue_scripts', 'nanoweb_resources');

My error is working, I mean if I do anything wrong in code, it display error.
According to my half in hour research, some logical error is there.
If anyone help me, I will not lose my motivation to learn this big part of custom wordpress themes.
Thank you in advance

Related posts

1 comment

  1. If your style sheet is not in the root directory of your theme, your second parameter should be the path to the stylesheet. You need to append the name of the stylesheet to the get_template_directory_uri() . '/path/to/sytlesheet.css'. Where /path/to/sytlesheet.css the location of the stylesheet with in the template folder.

Comments are closed.