I am building Twitter Bootstrap into my wordpress theme. I have managed to do that, and to include the jquery plugins. However I do not know where to put the "methods" in my theme.
Under Modals and then Methods (in fact for each plugin it has Methods) it gives different options that you can set. But I don't know where to put these snippets in my theme :(
I am building Twitter Bootstrap into my wordpress theme. I have managed to do that, and to include the jquery plugins. However I do not know where to put the "methods" in my theme.
Under Modals and then Methods (in fact for each plugin it has Methods) it gives different options that you can set. But I don't know where to put these snippets in my theme :(
I was just looking for how to add additional plugins, where that would go. I've created separate file for my jQuery plugins and linked to that in the footer, and that's working great.
No I've done all of that. I just wanted to be able to write "inline" (for want of a better word) jquery in some places, where it could still be accessed on all pages, but without altering the plugin scripts.
10635 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Sales & Support Lead
—
13th February 2012 (3 months ago)
#
Hiya AB,
Ok, if you want to have a specific jquery action take place on all pages you could write that "inline" in the theme header right? That would get it done as it's loaded everytime.
Thanks. If I still don't have it right for ya I'll ask for another set of eyes here that may be able to help :)
That's pretty much what I did (except I injected the additional actions through a separate file into the footer (as I believe the footer is generally best practice for jQuery/Javascript, except where specifically required in the header.
10635 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Sales & Support Lead
—
14th February 2012 (3 months ago)
#
Hiya AB,
You're right - putting it in the footer is the preferred method as it allows for more of the page to load more quickly. I only recommended the header because there are sometimes where it is required and didn't want that to be a blocker for seeing this working for ya.
Responses (7)
Sales & Support Lead — 8th February 2012 (3 months ago) #
Hiya Propaganda,
To use any custom javascript you need to call the source in your theme's files such as in the theme's function.php file. Something like so:
From there, you should add the appropriate selectors to your theme's markup as described on the page you linked to. Hope that helps!
Thanks!
Member — 8th February 2012 (3 months ago) #
Thanks,
I use that already in my functions.php.
I was just looking for how to add additional plugins, where that would go. I've created separate file for my jQuery plugins and linked to that in the footer, and that's working great.
Best wishes,
AB
Sales & Support Lead — 9th February 2012 (3 months ago) #
Hiya,
I guess I'm not following, sorry. When you say additional plugins, do you mean jQuery plugins/libraries? They'd all be done the same way.
Member — 9th February 2012 (3 months ago) #
Hi again.
No I've done all of that. I just wanted to be able to write "inline" (for want of a better word) jquery in some places, where it could still be accessed on all pages, but without altering the plugin scripts.
AB
Sales & Support Lead — 13th February 2012 (3 months ago) #
Hiya AB,
Ok, if you want to have a specific jquery action take place on all pages you could write that "inline" in the theme header right? That would get it done as it's loaded everytime.
Thanks. If I still don't have it right for ya I'll ask for another set of eyes here that may be able to help :)
Member — 13th February 2012 (3 months ago) #
Thanks for staying in touch with this.
That's pretty much what I did (except I injected the additional actions through a separate file into the footer (as I believe the footer is generally best practice for jQuery/Javascript, except where specifically required in the header.
Thanks again,
AB
Sales & Support Lead — 14th February 2012 (3 months ago) #
Hiya AB,
You're right - putting it in the footer is the preferred method as it allows for more of the page to load more quickly. I only recommended the header because there are sometimes where it is required and didn't want that to be a blocker for seeing this working for ya.
Glad to hear it's sorted now though :)
Become a member