Because WordPress loads jQuery in no conflict mode, $ is not accessible as a global variable. You need to explicitly use jQuery
.
jQuery(document).ready(function () {
jQuery("#login").loginWidget({
partnerRef: 0000,
});
});
If, like me, you want to use $ anyway, you can pass it to the ready function.
jQuery(document).ready(function ($) {
// you can use $ normally here now
$("#login").loginWidget({
partnerRef: 0000,
});
});
Edit:
Thought it might be useful to add if you want to use a self-initializing function instead of document ready you can pass that jQuery as well.
(function($) {
// use $ normally now
})(jQuery);
Related Posts:
- Apply jquery script to only woocommerce product pages and categories
- Enqueuing Script in functions.php vs on the page
- Ajaxing function in widget class
- jquery won’t load in footer
- Replace menu links with # and add name to its li
- Loading CDN that requires jQuery in WordPress
- Right way to update widget on dynamic new input field
- Scripts not appending to element in AJAX call – why?
- How to search using ajax for exact phrase or words in an input field?
- how to en-queue jQuery to load before the tag
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Run a jquery script on on a certain template page
- The correct way to add a JavaScript in the functions.php [closed]
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- How to load jQuery in TOP of wp_footer?
- Include Jquery libraries in wordpress theme?
- 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]
- Creating multiple category drop down
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- How to setup a popup registeration page in wordpress with function.php
- wp_set_object_term via js btn frontend
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Multiple Notifications SetInterval
- Automatic add space if user enters number(any digit)
- Why are some custom javascript files working but some are not
- How do I get my nav menu to show sub pages?
- Animated Accordion [closed]
- iOS and ajaxComplete
- How to load jQuery in the footer – nothing works for me
- Not sure if enqueuing js scripts properly
- Passing values from a widget to a function within a plugin
- Override widget in function WordPress
- Wp_query function to search from product_title ‘OR’ product tags name
- Allow Post Author to be 0 on Update
- Trouble with adding a wp_enqueue_script on wordpress
- List of JS Events for Widgets?
- WP Ajax Function Always Returning undefined
- Best practices regarding the creation of custom widgets?
- call of javascript function to external url always blocked by cors
- dynamic dependent select dropdown
- Ajax load more button for comments wordpress
- How to change the order of Jquery in the footer of my theme?
- How can I make a widget shortcode to control all the widgets?
- Including a specific Javascript Script in a template. Is my code correct?
- Jquery implementation not working on page reload
- Overwriting the menu break points of twentysixteen in child theme
- Replace a menu with widget or a custom template file programmatically
- How do I remove the date and category form my portfolio pages
- Attempt to change jQuery version caused White Screen of Death
- Access Customizer widget instance form
- PHP mixed with some JS code to update WordPress theme settings
- Custom taxonomy widget in admin area
- Dashboard widget custom positioning?
- Load jquery only for certain pages in the backend
- How do you Permanently Delete Sidebars
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- Add a jQuery Function
- WordPress Shortcode function display outside of widget
- Get rid of the widget Item Class=”widget-item”
- jQuery does not work
- using jQuery on only one page
- Javascript function not working when placed in Text Block
- Custom Sidebar only on single post
- Can’t call Javascript function – scope?
- Changing parent element’s class or style
- I have problems with loading javascripts
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- echo custom fields with AJAX
- Adding javascript to functions.php causes problems with my template
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Can’t Write Custom Widget Code In One ECHO
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- In jquery use php variable to execute an enqueued jquery file
- javascript and css links not working on sever
- Add php code to wp_print_scripts?
- How can i unload effect.min.js file?
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Loading two different AJAX requests on two different pages
- Enable right click on WordPress site
- Why i can’t get custom fields value or post ID via Ajax?
- Why is it so hard to add a class to the tag in the sidebar widget?
- Where is this JQuery coming from?
- Javascript not loading after the document ready
- Theme JS is available but theme CSS isn’t
- Passing user enetered value in widget: number of words, for example
- Create a Woocommerce product widget with category filter
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Need help with customalert that it would read on a normal page, but not in WordPress
- Add element to widgetpage
- “All posts” in the category widget
- Passing Jquery value to WordPress function
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- WordPress can’t get jquery/unslider to work
- Add loggedout class on body using a function or JS
- Are innerHTML elements visible to jQuery functions?
- widgets not working
- How to echo Widget Title in Custom Frontend-Template Box
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file