Articles of jquery

need to override function in jquery.ui.datepicker.js

In this location in wordpress /wp-includes/js/jquery/ui there is a file jquery.ui.datepicker.js I need to override this bit of code noWeekends: function(date) { var day = date.getDay(); return [(day > 0 && day < 6), ”]; }, to make it only show wednesdays (day > 2 && day < 4). Obviously I don’t want to do […]

WordPress Insert not working with ajax

I am trying to enter insert data with form in wordpress and want to use ajax for that. Without ajax it works fine but when I use ajax pressing the submit button gives 0 in result and the data is not inserted to the database . Below is my code. Html code is between form […]

Is there a default way in wordpress to create a overlay in the dashboard?

Is there a default way in wordpress to create an overlay in the dashboard area? I need a jquery ui dialog to open after a button click. This is how it goes: The button click will fire a PHP function using AJAX, which in turn will make an API call and the response will be […]

Why does deregistering jQuery cause other scripts not to load?

I’ve inherited a site using the following in functions.php: if ( ! function_exists( ‘foundation_assets’ ) ) : function foundation_assets() { if (!is_admin()) { wp_deregister_script(‘jquery’); } wp_enqueue_script( ‘new-slider’, get_template_directory_uri() . ‘/scripts/new.Slider.js’, array(), NULL, true ); } add_action( ‘wp_enqueue_scripts’, ‘foundation_assets’ ); endif; If I prevent this function from running, other plugins load additional scripts correctly. Has the […]

Safe method to temporarily load second jquery library to wordpress

For testing (and completely temporary purposes) I want to load a jquery cdn into my wordpress header.php file. I can’t determine if this is possible, and assume I’d need to setup for noconflict, etc. I’ve found documentation on it for the functions.php method, however the work for that would defeat the purpose of testing in […]

jQuery function not working

I have a very simple jQuery function that is supposed to toggle a div’s visibility: jQuery( “.signUp” ).click(function() { $(‘.signUpForm’).toggle(); }); The HTML is a simple signup form (hidden fields left out for brevity): <p><a class=”signUp” href=”#”>Sign Up!</a></p> <div class=”signUpForm”> <h3 class=”title”>Join our email list!</h3> <form action=”<url goes here>” method=”POST”> <label for=”email”>Email:</label><input type=”text” id=”email” name=”Email”/></br><br […]

Jquery ajax to custom php file: returning blank data

I created a custom php file, put it in my folder. The files does insert some data to the database to a custom table i created. require wp_path() . “/wp-load.php”; global $wpdb; $favorite_table = $wpdb->prefix . “fav”; $wpdb->insert( $favorite_table, array( ‘link’ => $_POST[‘fav_link’], ‘title’=> $_POST[‘title’]) ); $lastid = $wpdb->insert_id; echo $lastid; function wp_path() { if […]

Add a counter for mouseovers (custom field)

I am trying to count mouseovers on the div for each post. The div is inside the loop. I am almost there, I think you might have to just help me correct some mistake. The div and jquery. Notice that I am using the the_ID() to give the div an CSS id, which this allows […]

Remove Yoast jQuery from front end

I would like to remove the following two script and one style tags. They appear to be added by the Yoast SEO plugin, but looking through their plugin files yields nothing promising. Does anyone know where these are enqueued or another way to remove them? <!– / Yoast WordPress SEO plugin. –> <script type=”text/javascript” src=”″></script> […]

JQuery UI not loading without explicit loading of jQuery

I know there are a lot of questions regarding this issue, but I can’t figure out mine here. I’m trying to load the whole jQuery UI ( Actually I need only the Slider ) and I successed. This is my enqueing which is working: wp_enqueue_script(‘jquery-google-lib’, ‘’, array(‘jquery’), ‘2.1.4’); wp_enqueue_script(‘jquery-ui’, ‘’, array(‘jquery’), ‘1.11.4’); wp_enqueue_style(‘jquery-ui-css-google-lib’, ‘’); And […]