Enqueued style gets commented if not logged in


When using stylesheets I like to use wp_enqueue_style to have wp handle the loading. For some reason this works perfectly fine when I am logged in. But when I am not logged in the include statment gets wrapped in html comments, thus the browser doesn load the stylesheet.
When loading I use:
wp_enqueue_style("a-unique-name-style", plugins_url('/css/filename.css',path);

I also tried

function name_enqueue_style() {  
    wp_enqueue_style("a-unique-name-style", plugins_url('/css/filename.css',path));   
add_action( 'wp_enqueue_scripts', 'name_enqueue_style' );

But name_enqueue_style does not load at all. (Nothing in the error log either.)

I run this from both the plugin "main" php as from functions that build widgets.

What is happening? I don’t even know where to start looking.

pietervanderstar 5 months 2020-12-27T12:10:24-05:00 0 Answers 4 views 0

Leave an answer