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
- Opinions and recommendations on the best barebones base theme [closed]
- Customizing a WordPress theme without changing it?
- Where can I learn to create my own theme?
- Using classes instead of global functions in functions.php
- How do register_sidebar() and get_sidebar() work together?
- Display random categories on the front page (Finding and Editing Theme Functions)
- Custom Taxonomy-specific JavaScript
- Adding Language Support using .pot and .mo files to a WordPress Theme?
- 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?
- Building useful features into your theme
- Show a WP 3.0 Custom Menu in an HTML Select with Auto-Navigation?
- Display custom_background outside wp_head()
- Multisite: setting theme and options when a new blog is created
- How to get Ajax into a theme – without writing a plugin?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Editing theme files and access to the Code pages only to super-admin?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Change Default Image HTML
- Front End Post Submit Form
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Create a customizable child theme
- How to delete default themes
- Check javascript file Proper way in functions.php
- Extra User Profile Field Upload File / Image
- wp_head() remove redundant scripts?
- Edit raw HTML of the landing page
- Problem : deletion failed, the theme requested does not exist
- Theme Activation, Create Database Tables
- wp_head() not inserting the default stylesheet style.css
- 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
- Widgets not showing in my custom theme
- 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
- Theme Development Admin Area [closed]
- 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
- How can I defer these JS files?
- 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?
- Limitations when modifying wp_title with a filter
- Custom options below pages/posts editor?
- How to edit theme functions file to modify pagination?
- 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
- Problem of running development copy of WordPress on WebMatrix?
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Different logo on homepage
- the_content() is not displaying content, why? [closed]
- What is the correct way to integrate wordpress with another php application?
- 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
- Integrate WooCommerce theme with a WordPress theme [closed]
- Widget Option is Missing
- How do you use WordPress for a website that’s not in a blog format?
- Tips for managing code when developing a parent theme framework
- Trying to uninstall a theme, but it’s hijacking my home page
- Using JQuery to check for Rel Attribute of Image before Overriding It
- Getting a ‘slide down’ js panel implemented within WP
- 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?
- searchform.php doesn’t work properly
- How To Show Different Footers For Different Post Types Pages?
- Customizer: get_preview_url() inside customize_save_after hook
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How to use only scripts from new theme?
- Create theme for mobile phones and tablets only?
- How to add custom page elements to the WYSIWYG editor?