Enqueue and Register CSS -> Not Working
-
Hey there,
I just spent hours trying to register/enqueue a css file without success…
I just followed the codex example…I’m sure that :
– It’s a custom theme, not a child theme
– The demo.css file exists (root of the theme folder)Here is my code :
<?php
add_action( ‘wp_enqueue_scripts’, ‘my_css’ );
function my_css() {
echo DebugSomething;
wp_register_script(‘my_stylesheet’, get_template_directory_uri() . “demo.css”);
wp_enqueue_script(‘my_stylesheet’);}
?>
I’ve tried echoing something in my_css(), nothing happens.
If i replace– add_action( ‘wp_enqueue_scripts’, ‘my_css’ );
by
add_action( ‘init’, ‘my_css’ );The echo works fine… But the css file still wont load…
Am i missing something ?
Thanks A LOT for you help.
- The topic ‘Enqueue and Register CSS -> Not Working’ is closed to new replies.