New created theme not loading style.css
-
Following steps found online, I’ve created a new WP theme (very basic as of now) using WAMP localhost.
Everything I’ve done as per the various online tutorials has worked except the final step of loading the stylesheet. I’ve tried at least a dozen different variations of code found online in my function.php file to no avail. Nothing I add to the style.css has any effect on my site. If I add the css to the additional css section, it works. So what am I doing wrong in the function.php file that is preventing the stylesheet from loading
Here is my current functions.php code:
<?php wp_register_style( ‘style’, get_stylesheet_url() );
wp_enqueue_style( ‘style’, get_stylesheet_uri() );
?>
I’ve also tried this (which didn’t work):
<?php
function my_assets() {
wp_register_script( ‘style’, get_stylesheet_directory_uri() . ‘/style.css’ );
wp_enqueue_script( ‘style’ );
}add_action( ‘wp_enqueue_scripts’, ‘my_assets’ );
The topic ‘New created theme not loading style.css’ is closed to new replies.