views:

28

answers:

2

I'm trying to include my plugin stylesheet on my WP website (frontend), but for some reason it's not working.

function init_gallery_scripts() {
  if (is_admin() ) {
    // This works!
    wp_enqueue_script('gallery',  plugins_url('js/gallery.js',__FILE__),array('wp-filebrowser'));        
    wp_enqueue_style('gallery-css', plugins_url('style/gallery.css',__FILE__));
  } 
  else {
    // This is not woking. Why?
    wp_enqueue_style('gallery-front-css', plugins_url('style/gallery_front.css',__FILE__));
  }
}

I've also tried this with no success:

wp_register_style('gallery-front-css', plugins_url('style/gallery_front.css',__FILE__));
wp_enqueue_style('gallery-front-css');

Not sure what I'm doing wrong here.

A: 

Do you need any js if the user isn't an admin?

Sam Plus Plus
`is_admin()` is a Conditional Tag that checks if the Dashboard or the administration panels is being displayed. It's not a user role. Ref: http://codex.wordpress.org/Function_Reference/is_admin
Steven
PS. Your answer should be a comment to my question, and not post it as an answer.
Steven