Title: wp_register_script and enqueue_script help
Last modified: August 21, 2016

---

# wp_register_script and enqueue_script help

 *  [tonypg2013](https://wordpress.org/support/users/tonypg2013/)
 * (@tonypg2013)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wp_register_script-and-enqueue_script-help/)
 * I am currently trying to install the Bootstrap framework as my base template 
   for WP. I have the index.php, header.php, footer.php created and the css files
   registered by the bloginfo/@import process.
    But i am having trouble getting 
   the hook to and the register_script/enqueue_script process. Here is what i have
   at the moment.
 * This was removed from the footer.
 *     ```
       <!-- Le javascript
           ================================================== -->
           <!-- Placed at the end of the document so the pages load faster -->
           <script src="../assets/js/jquery.js"></script>
           <script src="../assets/js/bootstrap-transition.js"></script>
           <script src="../assets/js/bootstrap-alert.js"></script>
           <script src="../assets/js/bootstrap-modal.js"></script>
           <script src="../assets/js/bootstrap-dropdown.js"></script>
           <script src="../assets/js/bootstrap-scrollspy.js"></script>
           <script src="../assets/js/bootstrap-tab.js"></script>
           <script src="../assets/js/bootstrap-tooltip.js"></script>
           <script src="../assets/js/bootstrap-popover.js"></script>
           <script src="../assets/js/bootstrap-button.js"></script>
           <script src="../assets/js/bootstrap-collapse.js"></script>
           <script src="../assets/js/bootstrap-carousel.js"></script>
           <script src="../assets/js/bootstrap-typeahead.js"></script>
           <script>
             !function ($) {
               $(function(){
                 // carousel demo
                 $('#myCarousel').carousel()
               })
             }(window.jQuery)
           </script>
           <script src="../assets/js/holder/holder.js"></script>'
   
       This is the wp function that i called for accessing the functions.php file i have created
       <code><?php wp_footer();?></code>
   
       In functions.php i have this code
       ```
   
 * function bootpress_scripts_with_jquery() {
 *  wp_register_script(‘custom-script’, get_template_directory_url.() . ‘bootstrap/
   js/bootstrap.js’ array(‘jquery’));
    wp_enqueue_script(‘custom-script’); }
 * add_action(‘wp_enqueue_scripts’ , ‘bootpress_scripts_with_jquery’);
    ` Now do
   i need to add a wp_register_script for the jquery.js and the holder.js url’s 
   as they were in the code that was deleted. And as for the on load script do i
   leave that in the footer or what is best practice?

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

 *  Thread Starter [tonypg2013](https://wordpress.org/support/users/tonypg2013/)
 * (@tonypg2013)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wp_register_script-and-enqueue_script-help/#post-3823738)
 * missed the code tag on the functions.php code sorry.
 *  [cblockmedia](https://wordpress.org/support/users/cblockmedia/)
 * (@cblockmedia)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_register_script-and-enqueue_script-help/#post-3823927)
 * I am having issues getting my code to work! Each works independently, but not
   collectively… Any help?
 * function nix_scripts()
    { wp_enqueue_script( ‘toggle’, get_template_directory_uri().‘/
   js/toggle.js’, array( ‘jquery’) );
 * wp_enqueue_script( ‘tabs’, get_template_directory_uri() . ‘/js/tabs.js’, array(‘
   jquery’) );
 * wp_enqueue_script( ‘accordion’, get_template_directory_uri() . ‘/js/accordion.
   js’, array( ‘jquery’) );
    }
 * add_action( ‘init’, ‘nix_scripts’ );
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_register_script-and-enqueue_script-help/#post-3823928)
 * **[@cblockmedia](https://wordpress.org/support/users/cblockmedia/) **– please
   start your own thread per
 * [http://codex.wordpress.org/Forum_Welcome#Where_To_Post](http://codex.wordpress.org/Forum_Welcome#Where_To_Post)

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

The topic ‘wp_register_script and enqueue_script help’ is closed to new replies.

 * 3 replies
 * 3 participants
 * Last reply from: [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/wp_register_script-and-enqueue_script-help/#post-3823928)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
