It sounds like your template is missing a call to wp_head() which will output your enqueued scripts and styles. You’d normally place wp_head() in your header.php template and include this in your page template.
To conditionally enqueue jQuery based on the page template being used you could use the following code:
add_action( 'wp_enqueue_scripts', 'custom_theme_load_scripts' );
function custom_theme_load_scripts() {
if ( is_page_template( 'page-template.php' ) ) {
wp_enqueue_script( 'jquery' );
}
}
Keep in mind that plugins may require jQuery and therefore enqueue it on other pages/templates.
Related Posts:
- Correct Method to run scripts with dependencies without enqueue?
- How to prevent wordpress from loading old versions of jquery in wp_head();?
- How to get a jQuery script to run on a page?
- Including javascript for a shortcode
- WordPress Script Loading/Unloading — wp_deregister_script(‘jquery’)
- How to properly add Bootstrap and JQuery Javascripts?
- How to add unique image class to WordPress
- Disable Cloudflare Rocket Loader for jQuery javascript and make it load first
- Script not loading when depending on jQuery
- WP_ENQUEUE not working with Foundation 5
- How to use script in WordPress installation?
- JQuery Login Dropdown not functioning in theme
- How to deregister scripts all at once
- Javascript block in Twenty Twelve theme
- jQuery functions work in console, but not live
- Why is jQuery not working properly? [closed]
- jQuery equivalent of JavaScript’s addEventListener method
- How to send multiple data fields via Ajax?
- Adding an onclick function to go to url in JavaScript?
- Checking a Url in Jquery/Javascript
- Jquery Ajax Posting JSON to webservice
- How can I display a tooltip message on hover using jQuery?
- JQuery: $.get is not a function
- Bootstrap carousel not sliding
- jQuery: using a variable as a selector [duplicate]
- Slide right to left?
- jQuery – checkbox enable/disable
- How can I correctly format currency using jquery?
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- Using the WordPress Media Library and returning the Attachment ID rather than URL?
- WP set auth cookie using Ajax is not saved to browser
- Best approach for loading a sidebar Only if the screen max-width is >900px?
- Localize variable for multiple Shortcodes
- ajax call in wordpress front end
- Prevent five different copies of jquery from being included on every page
- javascript is not working on Event Submission?
- WordPress audio player causing js error, mediaelementplayer is not a function
- How to get a value from PHP in Jquery through Ajax
- Script for initializing JQuery Masonry for WordPress
- Combining media queries with image sizes
- Implementing lazy loading in homepage posts instead of pagination
- Jquery integration with my theme
- Is it possible to hide media details sidebar when wp.media popup is being opened?
- Correct way to write jQuery functions in WordPress
- Format numeric symbols in titles
- How can I make this custom menu work?
- Remove WordPress scripts
- Using bootstrap-slider and bootstrap-switch in wordpress admin panel
- Trouble with WordPress Ajax Login System – 302
- Why does javascript works only if logged in?
- Register jQuery – OOP WP
- How to isolate code to the post edit screen
- jQuery code not working in widgets page
- Load random posts without refreshing page (jQuery)?
- How to use jquery included with wordpress for jpanelmenu
- WordPress error when replacing local jQuery by externally-hosted
- Create special WordPress slideshow with “jquery.cycle.all.js”
- Superfish Menu Not Loading
- Convert UL to dropdown list not working
- How to add plugin with jQuery to custom theme?
- Change shortcode value by jquery in WP Editor
- How do I get my suggest to only suggest one taxonomy?
- Delete post image attachments with jQuery from the front end
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- Does WordPress support Plupload chunking when uploading asynchronously?
- Recommended Use of Bootstrap, or JQuery-UI in WP/plugin development?
- Slider’s missing navigation
- Assigning tags to a post from front end using tag-it jquery UI plugin
- wordpress before or after javascript problem
- Converting a working AJAX form to work with WordPress
- Accept a-z and 0-9 (restrict a-z to be lowercase without accents like ñ or ó)
- Get selected image URL from wp.media.editor.attachment into text input fails. What am I doing wrong?
- jQuery UI Accordion loading very slow
- Error on clicking ‘Screen Options’ tab only at Products-related editor screen(s) and for specific user
- I am trying to Implement a Code that is Working in my previous page but not working in WordPress for some reason
- Slide toggle Jquery UI
- Customizer add query to preview URL
- Pass jquery variable to php function and run it
- how to do display: block after user login
- How to send json data to jquery
- Reload selected post in multiple post query with ajax
- Change button text with user name using jQuery after user login
- Is there a way to move WPML scripts in footer?
- Jquery not loading / running on WordPress home page
- jQuery no conflict
- Youtube Iframe Api play one video at a time
- Load more button
- All post attachments in gallery grid to full screen slideshow?
- Can’t figure out why a jquery file is not loading!
- Scripts only working on home page
- Convert WordPress SACK code to new admin-ajax
- Ajax Query returns zero
- Custom jQuery plugin not working
- jQuery to work on WP custom page template
- ACF link withing website is good, but not external link?
- How do I load this jQuery to my wordpress page?
- Dynamically populate Cascading Dropdown from MySQL using JQuery/AJAX [closed]
- WP Supersized & Easy Fancybox Conflict
- jQuery conflict
- CF7 Populate Text Field Based On Checkbox Checked