From the wording of your question, you must be adding scripts by writing <script>
tags in your template. Add your own scripts via wp_enqueue_script()
in your template’s functions.php
, appropriately setting dependences on jQuery, and wp_head()
will add the scripts for you.
function my_scripts() {
wp_enqueue_script( 'my-sweet-script', get_bloginfo('template_directory') . '/script.js', array('jquery') );
}
add_action('template_redirect', 'my_scripts');
See the codex page for more info.
Related Posts:
- Any official way to create an admin theme?
- How to correctly add JQuery in a WP theme?
- WP 3.1 upgrade breaks AutoFocus+ theme
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Where can I learn to create my own theme?
- Using classes instead of global functions in functions.php
- Custom Taxonomy-specific JavaScript
- Splitting an Evolving Site into Multiple Sites, or Maintaining as One Site?
- Template for individual post designs
- Jquery in Child Theme
- Changing the visible url path to css & js files
- How can I get wp_head() as a string instead of echoing it?
- Show a WP 3.0 Custom Menu in an HTML Select with Auto-Navigation?
- Display custom_background outside wp_head()
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Change Default Image HTML
- Front End Post Submit Form
- Create a customizable child theme
- Check javascript file Proper way in functions.php
- Extra User Profile Field Upload File / Image
- wp_head() remove redundant scripts?
- Theme Activation, Create Database Tables
- Upgrading a custom theme through the Dashboard
- Will activating a different theme preserve custom settings to current theme?
- Can I apply a WP theme to a specific custom page template?
- Theme Customizer not loading
- WordPress theme with multiple color schemes
- Version control for both Vagrant config and themes being developed [closed]
- How to trigger function on theme delete?
- Setting a static home page and blog page without using the settings
- Two Navigation Menus – secondary nav is including main nav
- How to start learning CSS and theme development?
- Question about the way that wp_register_script works
- How do I make the category template display full posts instead of partial posts?
- Possible to put header-{your_custom_template}.php in subdirectory?
- Renaming the Twenty Fourteen WordPress theme
- Protect changes made to the theme when updating
- How to set a single theme directory on a multisite blog?
- WordPress Theme Development Seemingly Awful Partitioning of Includes?
- Why wp_head() function not loading style.css?
- How to add a second stylesheet to the editor
- How to add “Read More…” link in twentytwenty
- Customizer: Output default value in Customizer CSS
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Static page not working
- How to make theme elements customizable in wordpress?
- Custom options below pages/posts editor?
- JavaScript Files Registered in Parent Theme Won’t Load When Calling wp_enqueue_script() in Child Theme?
- How to add custom page attributes in WordPress?
- Customizer: active_callback and sanitize_callback incompatibility?
- Customizer: save setting/control content to post/page
- Menu jumping when calling it via PHP
- Different logo on homepage
- the_content() is not displaying content, why? [closed]
- Customizing page content layout
- Customize how a WordPress theme looks like in the Theme Selector
- WooThemes PremiumNews Theme jQuery Conflict with WordPress 3.2
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Widget Option is Missing
- Trying to uninstall a theme, but it’s hijacking my home page
- Using JQuery to check for Rel Attribute of Image before Overriding It
- Calling external Libraries in WordPress
- Most wp_nav_menu parameters ignored
- Using the same database on another Subdomain
- How to query details of images in gallery that is attached to a post
- Adding the jQuery to my theme that already exists in WordPress?
- How To Show Different Footers For Different Post Types Pages?
- How to use only scripts from new theme?
- Create theme for mobile phones and tablets only?
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Can’t change theme name
- display unique post per category
- Custom fields not displaying on front end
- My blog suddenly can’t find my stylesheet?
- Make theme settings support multisite enabled (WordPress Mu) site
- Is there any way to modify images from a theme using the web interface?
- jQuery is not defined – some theme features do not work!
- Bootstrap slider not working
- WordPress core jquery version file not loaded?
- Is hand coding required at all?
- Default and warning messages & no login
- dynamic image path within a javascript file
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- How to dowload and edit content of a website
- Display ads by location [closed]
- WordPress Dashboard Problem [closed]
- Theme Dev | Convert Template to Theme
- Managing Custom Designed Content
- Show posts from all categories
- Best strategy for providing theme options using customizer
- How Does One Create a Global Variable Repository
- WordPress custom jquery not found
- How to convert that page to a wordpress template? [closed]
- Theme Options Menu Item – Permission Issue
- why jquery is not loading in wordpress page?
- Turning WordPress Into full-featured website?
- Adding a wp_head hook from an included PHP file
- Javascript as Jquery Function Call?
- Static posts page is not working