• I’ve researched this extensively and have been unable to find a guide that adequately explains including JS with wordpress. They all come close, but none seem to boil it down to “how do I do this step by step?”

    I’m trying to create a sticky header via the files located at stickyjs[dot]com.

    How and where do I “include” jQuery and StickyJS? Some sites say to do it through the function.php file. Great. But once I’m there it’s a mess of code. And everytime I think I have it figured out, nothing happens.

    How and where do I “call” sticky?? The header.php file seems like the best place, but a whole lot of nothing is happening for me in that regard.

    I apologize if these seems flippant, I’ve just read through a thousand different tutorials and am stuck with a non-sticky header. I’d really just like to know how JS and jQuery work for this and any future need. Thanks.

Viewing 1 replies (of 1 total)
  • Your question is a bit general, so I would first read the Using JavaScript guide and then check out the wp_enqueue_script function.

    jQuery is included with the WordPress core so all you need to call is

    wp_enqueue_script( 'jquery' );

    in a callback to the appropriate hook (wp_enqueue_scripts or admin_enqueue_scripts, depending on whether you want to include it in the admin, or frontend area).

Viewing 1 replies (of 1 total)
  • The topic ‘Including JS/jQuery in General’ is closed to new replies.