wp_enqueue_scripts handle not being called in plugin
-
Hi guys,
I’m new to wordpress/php/apache in general, and I’m currently creating my first plugin. I’ve got the plugin running fine and want to add some css in the admin section.
The very best I’ve succeeded to do is to call this inside of my page:
wp_register_style("my-style.css", PLUGIN_URL."my-style"); wp_enqueue_style('my-style.css');
But it loads it in the body of the page, not in the header. My guess is that I should enqueue it like this:
add_action('wp_enqueue_scripts', 'prefix_add_style'); function prefix_add_style() { wp_register_style("my-style.css", PLUGIN_URL."my-style"); wp_enqueue_style('my-style.css'); }
But when I do that, the css file doesn’t show up anymore in the page source code.
I tried to provide any relevant information, but if you need more details, just ask them, I’ll gladly provide them.
Thanks for your help!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_enqueue_scripts handle not being called in plugin’ is closed to new replies.