Title: Styles and Scripts not loading
Last modified: August 21, 2016

---

# Styles and Scripts not loading

 *  Resolved [codeguerilla](https://wordpress.org/support/users/codeguerilla/)
 * (@codeguerilla)
 * [12 years ago](https://wordpress.org/support/topic/styles-and-scripts-not-loading/)
 * Hello. I am trying to load styles and scripts to my theme and it is not working.
   I am developing locally so I have no link to provide you. Below is code I added
   to functions.php. I am creating a custom theme.
 *     ```
       function add_required_scripts() {
          wp_register_script('bootstrap', get_template_directory_uri() . 'js/bootstrap.min.js', array('jquery'));
          // enqueue the script
          wp_enqueue_script('bootstrap');
       }
       add_action('wp_enqueue_scripts', 'add_required_scripts');
   
       function add_required_styles() {
       	wp_register_style('bootstrap',  get_template_directory_uri().'css/bootstrap.css');
           wp_enqueue_style('bootstrap');
       }
       add_action( 'wp_enqueue_scripts', 'add_required_styles' );
       ```
   
 * Just before the closing </head> tag I have added <?php wp_head() ?>, The admin
   bar is showing on the top of the page so I know thats working.
 * I also did a test to see if my functions.php file is loading by adding this to
   functions.php:
 *     ```
       <?php
       echo 'functions.php has been included';
       exit;
       ?>
       ```
   
 * Upon looking at the front of the site I get my message so I know functions.php
   has loaded as well, so I removed my test code.
 * It is not that I am including the wrong path to my files either, when I look 
   at the page resources there sre no style sheets or scripts loading at all other
   than what is automatically loaded by WordPress.
 * I used the code above for loading styles and scripts in my first WordPress project(
   this is my second WP project) and it worked fine. Not sure what I am missing.
   Any help would be greatly appreciated.
 * Cheers

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years ago](https://wordpress.org/support/topic/styles-and-scripts-not-loading/#post-4871524)
 * You;re missing a forward slash in each of your urls – eg:
 * `get_template_directory_uri() . 'js/bootstrap.min.js`
 * should be:
 * `get_template_directory_uri() . '/js/bootstrap.min.js`
 *  Thread Starter [codeguerilla](https://wordpress.org/support/users/codeguerilla/)
 * (@codeguerilla)
 * [12 years ago](https://wordpress.org/support/topic/styles-and-scripts-not-loading/#post-4871551)
 * Haha Derp. I thought I was loosing my mind there for a moment.
 * Thanks Esmi 🙂
 *  Thread Starter [codeguerilla](https://wordpress.org/support/users/codeguerilla/)
 * (@codeguerilla)
 * [12 years ago](https://wordpress.org/support/topic/styles-and-scripts-not-loading/#post-4871552)
 * Marking this resolved…

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

The topic ‘Styles and Scripts not loading’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [codeguerilla](https://wordpress.org/support/users/codeguerilla/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/styles-and-scripts-not-loading/#post-4871552)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
