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 How to Build a WordPress Theme Preparing to Code WordPress Templates Linking JavaScript

Luke Lee
Luke Lee
7,577 Points

Prevent JQuery conflict

I understand what the following codes do. But what if I install more plugins which also use jquery in the future? Do I have to keep adding code in this file? Where do I learn how to write these codes??

jQuery(document).ready(function($)) {
            $(β€˜.flexslider’).flexslider();
        }

1 Answer

Matt Campbell
Matt Campbell
9,767 Points

No you won't Luke Lee

WordPress comes packaged with the jQuery libraries. You can choose to use Google's library but the WP one is pretty up to date.

I believe that the flexslider plugin that is being used in the tutorial is a jQuery plugin rather than a WP plugin. Thus, you need to treat it as if it is not in WP and thus, include the scripts and run the functions etc.

As for learning the code, you're doing so right now. Just keep going and you'll get it all covered. Next step is to grab your editor and start building a site from scratch. You'll learn masses doing that.