ThemeShaper Forums » Thematic

Best way to add additional jQuery scripts

(7 posts)
  • Started 13 years ago by Artboredom
  • Latest reply from jbtank
  • This topic is not resolved
  1. I've gotten pretty good at dissecting and molding WordPress to do what I want, and I'm enjoying working with Thematic as well. I'm building two client sites on it right now. But I've run into a wall which brings me to my question.

    You call everything in the header in a way I'm unfamiliar with. I'm sure that I could figure it out after some trial and error, but I'm a TIGHT deadline to say the least! :) So what I needed to know is how I would go about adding more jQuery scripts into the Scripts.PHP file? I'm looking to add scripts for content galleries, lightboxes, and tooltips. So I'll need to be able to call all the various files for those scripts.

    Am I just replicating everything within the PHP but changing it to see each of my various other scripts? Do I do one for each script that I need to load?

    Any help you guys could provide would be greatly appreciated.

    Posted 13 years ago #
  2. I would just hook your additional scripts into wp_head().

    Posted 13 years ago #
  3. Hello Ian, I must be missing something obvious here. So bear with me. :)
    What exactly do you mean when you say into wp_head()? Do you mean within the same area that all the thematic_example()are being called ending with wp_head(); ?>?

    Or do you mean anywhere within the header.php file's <head></head>? I've tried several variations and none of them work. I'm pretty sure that the path is correct as well.

    Sorry if I'm being dense, but I usually throw everything within the head of the page - CSS first, jQuery call, then the scripts and everything works. If there is an example of what you're talking about I would love to see it. I'm also keeping all my scripts within the wp-includes/js/ folder like I usually do for everything. Should they still be kept there?

    Thanks again for your help Ian.

    Posted 13 years ago #
  4. danno

    Working on this myself and would love some additional clarification for how to hook additional scripts into wp_head()

    Posted 13 years ago #
  5. This would go in your Child Theme functions.php:

    function childtheme_scripts() {?>
        <!-- your link tags here -->
    <?php }

    And once you know how to do that, you know how to inject HTML or PHP into any hook. Good luck!

    Posted 13 years ago #
  6. danno

    Thanks, Ian! I'll give it a go! Thanks for a great framework.

    Posted 13 years ago #
  7. jbtank

    Whoops wrong thread!

    Posted 13 years ago #

RSS feed for this topic


You must log in to post.