pico
pico

Reputation: 247

Uncaught TypeError: $.widget is not a function in Wordpress Theme

I'm planning to use jQuery autocomplete combo in theme. Loaded script files as follow in header.php

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

When I try it I got javascript error as Uncaught TypeError: $.widget is not a function. This is jquery ui autocomplete demo and I try it at JSFiddle also worked as demo. That's JSFiddle working demo. I got $.widget error When I add it in wordpress theme. How can I fix it

Upvotes: 1

Views: 9269

Answers (2)

Yunus Turan
Yunus Turan

Reputation: 1

if anyone is still getting this error I solved this error by installing this plugin for wordpress. https://wordpress.org/plugins/jquery-ui-widgets/

Upvotes: 0

Mohamed Ali
Mohamed Ali

Reputation: 11

you need to call jquery ui widget in theme's functions.php

wp_enqueue_script('jquery-ui-widget');

Upvotes: 1

Related Questions