• 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.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Not able to include plugin stylsheet in front end’ is closed to new replies.