Title: Using wp_enqueue_style
Last modified: August 20, 2016

---

# Using wp_enqueue_style

 *  [emerginggeek](https://wordpress.org/support/users/emerginggeek/)
 * (@emerginggeek)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/)
 * Hi all,
 * I am VERY new to WordPress, so this might be a pretty basic question.
 * I have been playing with theme development for a few weeks and have decided to
   start from scratch, not even using a reset theme, just to figure out how things
   go together.
 * I have heard that the best practice is to use the wp_enqueue_style to call your
   css. I can, and have copied and pasted the href=”<?php bloginfo( ‘stylesheet_url’);?
   > from the twentyeleven theme, and it works, but I would like to do it the right
   way.
 * I might be thick, but I am not sure how to use it. If someone could explain like
   I’m five, I would appreciate it. My specific question is do you use the wp_register_style
   in the themes function.php? Or is it already in wp .phps somewhere? Do I add 
   style.css to the parameters, nothing, or the absolute file path?
 * Any help would be appreciated, and you cannot get too basic with me.
 * Thanks all

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

 *  [Prasanna SP](https://wordpress.org/support/users/prasannasp/)
 * (@prasannasp)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/#post-3151816)
 * Register the stylesheet first
 *     ```
       function register_my_theme_styles(){
               if ( ! is_admin() ){
                       wp_register_style( 'my-theme-stylesheet', get_stylesheet_uri(), array(), false, 'screen' );
               }
       }
       add_action( 'init', 'register_my_theme_styles' );
       ```
   
 * Then enqueue it
 *     ```
       function enqueue_my_theme_styles(){
               if ( ! is_admin() ){
                       wp_enqueue_style( 'my-theme-stylesheet' );
               }
       }
       add_action( 'wp_enqueue_scripts', 'enqueue_my_theme_styles' );
       ```
   
 * [get_stylesheet_uri](http://codex.wordpress.org/Function_Reference/get_stylesheet_uri)
   gets the style.css URL of your theme. If you want to register other style sheets(
   say `ie.css`), use [get_template_directory_uri()](http://codex.wordpress.org/Function_Reference/get_template_directory_uri).
   Example, to register `ie.css` style sheet.
 *     ```
       wp_register_style( 'my-theme-ie-stylesheet', get_template_directory_uri() . '/ie.css', array(), false, 'screen' );
       ```
   
 * then enqueue it (in the `enqueue_my_theme_styles` function)
 *     ```
       wp_enqueue_style( 'my-theme-ie-stylesheet' );
       ```
   
 *  Thread Starter [emerginggeek](https://wordpress.org/support/users/emerginggeek/)
 * (@emerginggeek)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/#post-3151818)
 * Do I register the stylesheet in the functions.php? I assume I enqueue it in the
   head.php?
 * Thanks for your help. I struggle sometimes!
 * Dave
 *  [Prasanna SP](https://wordpress.org/support/users/prasannasp/)
 * (@prasannasp)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/#post-3151819)
 * Yup, this goes in `functions.php`. But, no need to add anything to head.php. 
   When you enqueue it, WordPress automatically adds reference to the style sheet
   in head.
 * **EDIT**:
    Both registering and enqueueing style sheet is done in functions.php
   itself.
 *  Thread Starter [emerginggeek](https://wordpress.org/support/users/emerginggeek/)
 * (@emerginggeek)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/#post-3151835)
 * Great! Thanks for your help. I am sure that I will be back as I keep working 
   at this!
 *  [thoughtwell](https://wordpress.org/support/users/thoughtwell/)
 * (@thoughtwell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/#post-3151882)
 * Thanks for this, Prasanna. Works beautifully so far in 3.5 w/ the Bones Framework
   I’m using. I needed to call some styles for a webfont service, and this works
   great. I’ll have to look a little closer sometime to learn what the ! is_admin
   function does.

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

The topic ‘Using wp_enqueue_style’ is closed to new replies.

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [thoughtwell](https://wordpress.org/support/users/thoughtwell/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/using-wp_enqueue_style/#post-3151882)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
