I'm using the following to enqueu an admin style:

wp_enqueue_style('pk-admin-css', PULUGIN_URL . 'css/admin.css');

This outputs the style file appended with the ?=ver parameter which results in the file loading with no content.

I can fix this by removing that parameter like so:

wp_enqueue_style('pk-admin-css', PULUGIN_URL . 'css/admin.css', array(), null)

basically give it the version a nul value which removes it. My question though is.. The front-end style loads fine with that version number but why my admin style is not? Can someone explain this for me?

Thank you.

  • This is strange. Could you please provide a screenshot of your browser's console?
    – Johansson
    Nov 19, 2017 at 12:39

2 Answers 2


It has nothing to do with version. First of all you have a typo in constant name: PULUGIN_URL. Even if you change it to PLUGIN_URL, it will not work, because such constant does not exists. When you do it from within plugin, use proper function. In your case it should be: plugin_dir_url(__FILE__). Your code should be:

function wpse_enqueue_style() {
    wp_enqueue_style('pk-admin-css', plugin_dir_url(__FILE__) . 'css/admin.css');
add_action( 'admin_enqueue_scripts', 'wpse_enqueue_style' );
// load css into the admin page use admin_enqueue_scripts or admin_print_styles

function mytheme_enqueue_options_style() {
    wp_enqueue_style( 'mytheme-options-style', get_template_directory_uri() . '/css/admin.css' ); 
add_action( 'admin_enqueue_scripts', 'mytheme_enqueue_options_style' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.