Title: Need to keep certain java in the header!
Last modified: August 30, 2016

---

# Need to keep certain java in the header!

 *  Resolved [gurusurfer](https://wordpress.org/support/users/gurusurfer/)
 * (@gurusurfer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/need-to-keep-certain-java-in-the-header/)
 * Hi,
 * Thanks for the amazing plugin, all is working great, however, i need to let the
   plugin leave the revolution slider java in the head because the slider is breaking
   when moved to footer.
 * How to restrict that certain java not to be moved down?
 * Thanks
 * [https://wordpress.org/plugins/scripts-to-footerphp/](https://wordpress.org/plugins/scripts-to-footerphp/)

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

 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/need-to-keep-certain-java-in-the-header/#post-6624683)
 * Glad it’s working for you, and that is something that is totally achievable! 
   There is a filter to keep specific scripts in the footer. You’ll need the script’s
   handle or slug used when it’s [enqueued](https://codex.wordpress.org/Function_Reference/wp_enqueue_script).
   If you don’t know it, you’ll need to either search for the `wp_enqueue_script`
   in the plugin files or contact the plugin developer.
 * There’s an example on the [main plugin page](https://wordpress.org/plugins/scripts-to-footerphp/)
   as well as the [documentation](https://github.com/joshuadavidnelson/scripts-to-footer/wiki#keeping-scripts-in-the-header).
   Basically, it would look something like this placed in your functions.php file:
 *     ```
       add_filter( 'stf_exclude_scripts', 'stf_custom_header_scripts', 10, 1 );
       function stf_custom_header_scripts( $scripts ) {
           $scripts[] = 'revolution-slider'; // replace 'revolution-slider' with the CORRECT script slug/handle
           return $scripts;
       }
       ```
   
 * This should place all dependencies for the slider in the header as well, so if
   it needs jQuery to run properly, jQuery will also be placed in the header – in
   the correct order. No need to check the “keep jQuery in the header” box in that
   scenario (though it should still work either way). Of course, that’s only if 
   the revolution slider script is enqueued properly.
 * You might also want to see [this support post](https://wordpress.org/support/topic/unsure-of-where-to-put-filter?replies=4#post-7453564)
   if the above doesn’t quite work for you – if there are in-line scripts being 
   placed in the `wp_head` hook it might not print out as expected.
 * Hope that helps – let me know if you have any other questions or issues.
 * Thanks,
    Joshua
 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/need-to-keep-certain-java-in-the-header/#post-6624968)
 * gurusurfer, I’m hoping/guessing this worked for you, since it’s been a month 
   I’m going to mark this topic as resolved. Reach out if there are any issues, 
   though!
 *  [gezginrocker](https://wordpress.org/support/users/gezginrocker/)
 * (@gezginrocker)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/need-to-keep-certain-java-in-the-header/#post-6624974)
 * Hi,
 * I have a question, how can we add multiple slugs? I tried adding them as in example
   below, but it returned a syntax error.
 * `$scripts[] = 'strx-magic-floating-sidebar-maker', 'debounce';`
 * Also, at the plugin page and documentation if you mention that we need to add
   those codes to the theme’s functions file, probably it’ll be easier for newbies
   like me. I spent some time figuring where exactly to place the code. 🙂 And thanks
   for the plugin.
 *  Plugin Author [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * (@joshuadnelson)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/need-to-keep-certain-java-in-the-header/#post-6624978)
 * [@gezginrocker](https://wordpress.org/support/users/gezginrocker/) We covered
   this in your support post, correct? Let me know if there were more questions 
   or issues, though.

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

The topic ‘Need to keep certain java in the header!’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/scripts-to-footerphp_fcfefd.svg)
 * [Scripts To Footer](https://wordpress.org/plugins/scripts-to-footerphp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/scripts-to-footerphp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/scripts-to-footerphp/)
 * [Active Topics](https://wordpress.org/support/plugin/scripts-to-footerphp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/scripts-to-footerphp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/scripts-to-footerphp/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Joshua David Nelson](https://wordpress.org/support/users/joshuadnelson/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/need-to-keep-certain-java-in-the-header/#post-6624978)
 * Status: resolved