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 influence the information displayed on widget inside wp-admin
- How can I get $id variable in widget’s form function?
- Does WordPress Development Mode Exist (with not minified JS)?
- Using add_filter() in Widgets
- AJAX handler throws 400 (Bad request) – why?
- remove the wrapping of text widget or
- Replacing select2 in admin backend for all selects
- Authors details such as social media links, emails etc → Is this Meta or something else?
- Enqueuing External Javascript functions.php
- What is the most efficient method for loading widgets in functions.php
- Properly applying nonce to a form using AJAX
- Add external js file to footer with id
- Clean-up script tags
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Move jQuery and Migrate to footer?
- Why is my Gutenberg block returning an error after initial save?
- AJAX Contact Form Issue
- How to filter a table in post content without plugins? [closed]
- jQuery UI inside widget on admin page
- How to hide unused profile fields?
- wp_register_script(… $in_footer = true) not working
- Override widget in function WordPress
- call of javascript function to external url always blocked by cors
- Jquery implementation not working on page reload
- Overwriting the menu break points of twentysixteen in child theme
- 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?
- How do you Permanently Delete Sidebars
- using jQuery on only one page
- Custom Sidebar only on single post
- 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
- Need help with customalert that it would read on a normal page, but not in WordPress
- Passing Jquery value to WordPress function
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- Dequeue scripts in IE7 only using functions.php
- How to conditionally add a widget via a hook in functions.php
- How Do I include/Import a Custom Widget from the Parent theme into My Child Theme?
- Add a custom function to widget code
- Get URLs for AJAX Filter Checkboxes WordPress
- How to change text color depending on the number value (Using javascript)
- Add custom taxonomy using JS in post editor
- Display Script in Header When URL Variable Present
- Enable accessibility mode in widget as default
- What is the earliest Hook a Script can use?
- WordPress does not load jQuery
- post value to function with Ajax and jQuery
- Trying to change widgets h-tags
- Ajax in plugin fails – but only on one blog – no idea why
- How do i create a search option for pdf’s only
- Load scripts into an AJAX div
- How to add widget in main menu
- admin-ajax.php & my wp-admin folder url showing in header
- True parameter but jquery register in header and not in the footer with wp_register_script
- wordpress ajax is not working for dropdown selection
- Search and Replace Script Loader in Head Only Works in Footer
- Slider from different widgets
- custom post with loading script per single post
- wp_nav_walker that interacts with widgets to setup mega menu
- jQuery HoverIntent is not a function
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- Ajax call does not work for this custom code
- Add the title of a widget as an ID – for anchor links
- new to javascript – using in instead of functions.php, not loading correctly
- AJAX values converted to PHP Variables?
- Widget won’t work due to old JavaScript? Any ideas how to make it work? [closed]
- comment_post function with js not running
- dynamically import array from another js file in WordPress