Title: WP Enqueue Styles &#8211; Plugin
Last modified: August 30, 2016

---

# WP Enqueue Styles – Plugin

 *  Resolved [Georgeba](https://wordpress.org/support/users/georgeba/)
 * (@georgeba)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/)
 * I’ve been reading about wp-enqueue and used their example and modified it to 
   my own..
    (This is in my Plugin.php)
 *     ```
       /**
        * Proper way to register and enqueue scripts and styles
        */
       function stepline_stylesheets() {
           wp_register_style( 'stepline-min',  get_template_directory_uri() .'/css/Stepline.min.css', array(), null, 'all' );
           wp_register_style( 'stepline-css',  get_template_directory_uri() .'/css/style.css', array(), null, 'all' );
           wp_enqueue_style( 'stepline-min' );
           wp_enqueue_style( 'stepline-css' );
       }
       add_action( 'wp_enqueue_scripts', 'stepline_stylesheets' );
       ```
   
 * For some reason, this isn’t working? I’ve been confused for a while now.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/#post-6880707)
 * Hi there!
 * Are you using this code in an active theme or is this on an active plugin? If
   you are using a plugin do note they use different functions to get their directory
   paths.
 * Have you tried deactivating all your plugins to see if that resolves the issue?
 *  Thread Starter [Georgeba](https://wordpress.org/support/users/georgeba/)
 * (@georgeba)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/#post-6880746)
 * I did rename my wp-content directory to assets, could that have messed this up?
 *  Thread Starter [Georgeba](https://wordpress.org/support/users/georgeba/)
 * (@georgeba)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/#post-6880747)
 * changed it back, deactivated other plugins, switched to another theme. Still 
   not working.
 * This is an active plugin
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/#post-6880775)
 * So this is a plugin you are developing?
 * If it is a plugin then the function you would want to use is `plugin_dir_url()`
   not `get_template_directory_uri()` because the second function will return the
   active ( or parnt ) theme’s directory. For example, if my CSS file is in the 
   Twenty Sixteen’s `css` folder I would use:
 *     ```
       wp_enqueue_style( 'neat-o-style', get_template_directory_uri() . '/css/neat.min.css' );
       ```
   
 * That would return something like:
 *     ```
       https://superawesomemccool.net/wp-content/themes/twentysixteen/css/neat.min.css
       ```
   
 * But if it were in a plugin I would use:
 *     ```
       wp_enqueue_style( 'neat-o', plugin_dir_url( __FILE__ ) . 'css/neat.min.css' );
       ```
   
 * And that would return:
 *     ```
       https://superawesomemccool.net/wp-content/plugins/cooliastyles/css/neat.min.css
       ```
   
 * Hope that makes sense. 🙂
 *  Thread Starter [Georgeba](https://wordpress.org/support/users/georgeba/)
 * (@georgeba)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/#post-6880782)
 * Thank
    You so much!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WP Enqueue Styles – Plugin’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 5 replies
 * 2 participants
 * Last reply from: [Georgeba](https://wordpress.org/support/users/georgeba/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/wp-enqueue-styles-plugin/#post-6880782)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
