You have to load your javascript Snippet inside your header.
You’ll have to options:
- Edit your themes header.php and put the code before the closing tag
- Insert your code into the header with a custom function inside your functions.php
function my_custom_js() {
echo '<script type="text/javascript">
jQuery(document).ready(function($){
jQuery("#double-scroll").doubleScroll();
});
</script>';
}
// Add hook for front-end <head></head>
add_action('wp_head', 'my_custom_js');
Related Posts:
- Most efficient way to add javascript file to specific post and/or pages?
- Pass media upload value to input field
- Combine CSS and JS files from plugins
- JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error
- WordPress Ajax always returns a 404 error
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- How to use WordPress (PHP) functions in AngularJS partials files?
- Nice scroll to wordpress
- Using an Image Slider twice on the same page
- Click loads template via ajax
- Display notification only once
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Using wp_localize_script to store the template url into a variable to use in JS
- How to speed up admin-ajax.php in wordpress
- JQuery not working on WordPress Admin page [closed]
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- Sending jsPDF documents to the server
- Ajax return code 400
- Show post in slider
- Using shipped version of jquery
- How to test nonce with AJAX – Plugin development
- js file in root loading without
- class click counter save number
- Slider loading issue
- AJAX request status 200 but no actual “response”
- How to select the contents in the text view textrea in wp_editor?
- Save Search System
- dynamic dependent select dropdown
- Ajax load more button for comments wordpress
- How to add a do_action on refreshing of WP customizer?
- Menu jumping when calling it via PHP
- Setting value of session with Ajax not working
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Add / Update Custom Fields After Select Pictures in Media Window
- Post repeating with infinite scroll
- Fancybox type popup window that’s not an iframe
- How do I Import / Upload Files with jQuery AJAX?
- WordPress Ajax Call inserting data but success response false
- Error – ‘create_function is deprecated’ [closed]
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- Is it save to use eval for a jQuery callback method coming from the database?
- Jquery window.send_to_editor function
- How to add drag and drop functionalities to a div inside option panel
- Why i can’t get custom fields value or post ID via Ajax?
- JS file is not loading when i put wp_head() and wp_footer
- Accessing an API with jQuery and AJAX
- Replacing WordPress Icons (menu,icons32, etc)?
- Covert WordPress Blogname into JQuery
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Hot to check if new posts have been published since page load and notify online users?
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- Add other class content with reference class value
- Admin-ajax.php 404 error
- How to pass values from one function to the other using an array variable
- How to use wp_ajax_set_post_thumbnail?
- Update $wpdb query with AJAX
- AJAX to add to cart multiple products woocommerce
- Using wp_editor() when not logged stopped working
- Show the subcategory name based on current product
- Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
- Move Jquery.js to Footer
- How to echo a PHP code into WooCommerce variation product?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- How to call a function from functions.php with ajax?
- WordPress load javascript file if something… (after the page is loaded)
- include javascript Multiple files in wordpress through script.js
- number of posts with “Load More”
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- Find the method which AJAX GET calls
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- How to create a radio button to alt between settings in wp_options table
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Slider from different widgets
- How to call javascript function (jquery) in a shortcode?
- 500 (Internal Server Error) of external php file
- How can I correctly POST to a WordPress page?
- Why this plugin is not working?
- Dynamic Gallery
- Trying to fix multiple category drop down
- Cannot get custom javascript to execute on page
- Add specific phrase after every product title including the discounted price? [closed]
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- JSON Object Value Show Undefine
- Adding jquery using php function
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- notify users when changed database
- get_post_meta returns on side but it doesn’t return on bottom of admin page
- jQuery functions only work on homepage
- WP functions in .js
- How to prevent XSS alter custom global javascript object & methods in WordPress
- How can i display a jquery slide on front page
- Is the wp_enqueue method efficient?
- Executing php on button press
- If user has clicked link add class and store using PHP/WordPress
- wordpress ajax pagination
- Execute PHP code in Javascript onclick