Title: wp_enqueue_scripts for stylesheets not working
Last modified: August 20, 2016

---

# wp_enqueue_scripts for stylesheets not working

 *  Resolved [creariz](https://wordpress.org/support/users/creariz/)
 * (@creariz)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-for-stylesheets-not-working/)
 * I´ve been reading a lot to try to solve this problem, and right now I really 
   don´t know what´s wrong.
 * I have the following code inside my functions.php and it doesn´t work. It causes
   the webpage not to load. If I delete it the webpage works perfectly.
 *     ```
       function add_my_stylesheets() {
       	if(!is_login() && !is_admin()) {
       		wp_register_style(style-general', get_stylesheet_directory_uri() . '/includes/css/style-general.css');
       		wp_register_style(style-ltie9', get_stylesheet_directory_uri() . '/includes/css/style-ltie9.css');
       		wp_register_style(style-ltie8', get_stylesheet_directory_uri() . '/includes/css/style-ltie8.css');
       		$GLOBALS['wp_styles']->add_data( style-ltie9', 'conditional', 'lt IE 9' );
       		$GLOBALS['wp_styles']->add_data( style-ltie8', 'conditional', 'lt IE 8' );
       		wp_enqueue_style(style-general');
       		wp_enqueue_style(style-ltie9');
       		wp_enqueue_style(style-ltie8');
       	}
       }
       add_action('wp_enqueue_scripts','add_my_stylesheets');
       ```
   
 * I would appreciate some help.

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

 *  [James Edmonston](https://wordpress.org/support/users/james-edmonston/)
 * (@james-edmonston)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-for-stylesheets-not-working/#post-2485487)
 * Have you tried echoing anything inside the if statement to check that it’s actually
   working?
 *  Thread Starter [creariz](https://wordpress.org/support/users/creariz/)
 * (@creariz)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-for-stylesheets-not-working/#post-2485586)
 * Thank you James. That was the actual solution to the problem. I really didn´t
   need the condition, cause wp_enqueue_scripts doesn´t run on admin pages or the
   login. Everything is working now.

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

The topic ‘wp_enqueue_scripts for stylesheets not working’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [creariz](https://wordpress.org/support/users/creariz/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-for-stylesheets-not-working/#post-2485586)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
