Use conditional is_page()
for loading script on specific page.
Here Is The Modified Version of Your Function:
//Load Scripts
function load_scripts(){
wp_deregister_script('jquery'); // De-register Existing jquery
wp_register_script('jquery', 'http://code.jquery.com/jquery.js', '', '', true);
wp_enqueue_script( 'jquery' );
wp_register_script('bootstrap-jquery',get_template_directory_uri().'/assets/js/bootstrap.js', array( 'jquery' ), '', true);
wp_enqueue_script( 'bootstrap-jquery' );
// register the script
wp_register_script( 'my-script', 'URL to Script' ); // by default script will load to head
// conditionally load page
if (is_page( 'Contact' )) {
wp_enqueue_script('my-script');
}
}
Related Posts:
- How to include jQuery and JavaScript files correctly?
- jQuery in header or footer
- How to get the value entered in the input field in wordpres
- How react js and other Javascript Technologies works on WordPress plugin?
- ajaxurl not defined on front end
- Why does WordPress use outdated jQuery v1.12.4?
- Test to see if jQuery or Prototype is queued by another plugin?
- Include third party Javascript library which is not included in WordPress
- Hook the Keydown Event in the TinyMCE Post Editor
- How to trap “Publish” button to check for meta box validation?
- Use js script from one plugin in another plugin
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- What’s the better way to add an inline script?
- Mixing Regular Javascript With jQuery in a Plugin
- Is there an event or an other method that tells me the preview is loaded?
- javascript datatables in a plugin
- WordPress custom taxonomy check box to dropdown
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- WP Plugin Running before jQuery
- should i be checking for jquery before enqueing it in a plugin
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Need help about understand api, wp, $ syntax in WordPress plugin script
- Insert Into Post Not Working For Audio File Using jQuery
- Using function from enqueued .js file in theme in plugin?
- wp.media gallery collection sometimes undefined
- Query String Filtering API
- jQueryUI draggable doesn’t work in WordPress plugin
- Filterable posts using categories
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Loading jQuery library from WordPress admin
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- Insert meta-description into Yoast-SEO input-field via JavaScript
- How to get the path to the current theme?
- How to add a javascript snippet to the footer that requires jQuery
- Remove profile picture option (and other things) from profile.php (in admin)
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Update exisiting site to 3.5 release candidate
- Get file headers in custom file
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- How do I use WordPress PHP functions in my Javascript code?
- WordPress plugin options and jQuery
- Can’t get JS code to work with shortcode
- How do I add a javascript file to all admin pages via a plugin?
- Is there any way to have Featured Text, as opposed to Featured Image?
- Find source of notice / warning / errors efficiently
- Problem with is_active_sidebar?
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Add a row on clicking each post featured image
- Short code not working in boostrap modal dont no why?
- Is there a way to list all actions registered by a plugin or theme?
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- How developed with version control word press site on shared host? [closed]
- How to limit number of number of categories displayed by categories widget
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- add javascript files only when plugin is called?
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Is it necessary to do validation again when retrieving data from database?
- Make a plugin page out of influence of the theme’s style
- jquery & ajax sending data to php
- 400 Bad Request, in wordpress theme development, wp_ajax
- how to get the post id in plugin
- jquery in wordpress plugin with depdendency
- Ajax +wordpress onClick link redirect to new page and create html content
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How can the_excerpt (or equivalent) be called on a category description?
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- wp.media libary pdf type
- How to access index file in Block Themes?
- escape html in jQuery for WordPress
- Jquery php request is returning a weird result
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Redirection from a specific page for users logged in but not with membership
- How to enqueue scripts properly with ES6 webpack?
- Load script on frontend from widget plugin
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Font Awesome stopped showing icons, shows &# text instead [closed]
- How can I add the Post ID to Class Name in Jquery?
- Managing Custom Designed Content
- How would I get this to work – send to post from thick box
- Generate activation url
- Ajax, jQuery and WordPress
- How do I call the dashboard’s sortable javascript in a plugin page?
- Ajax functions – no access to wp-admin.php only online
- Set start page depending on screen width [closed]
- Saving multiple fields as array
- Gutenberg text field validation
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?