Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Setup a Bootstrap Theme Add Bootstrap JS via the functions.php File

Adding jquery ui?

How do i get jquery-ui to work in wordpress, as my jquery in dependent on jquery-ui for slider etc.?

2 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Yup, you would do something like this:

https://codex.wordpress.org/Function_Reference/wp_enqueue_script#Link_a_Theme_Script_Which_Depends_on_jQuery

But you could replace this:

get_stylesheet_directory_uri() . '/js/custom_script.js',

With something like this:

'https://code.jquery.com/ui/1.11.4/jquery-ui.min.js',

Also, check out this post on StackExchange (good place to search for stuff like this):

http://wordpress.stackexchange.com/questions/7221/how-to-correctly-include-jquery-ui-effects-on-wordpress

My first thought would be to link to it the same way you linked to the bootstrap.min.js file. Take a look at the functions.php page and use Zac's example. You'll have to download the jquery-ui and put it in the right folder but you should be able to import it like any other javascript file.