extra code in – blank jquery function

As per comments: this code is not doing anything. To find the culprit, first change your theme to a standard one to see if the theme is adding it. If yes, check header.php if it is hardcoded there or else functions.php for any instances of add_action(‘wp_head’…, where it might be lingering. If it’s not the … Read more

Does WordPress support Plupload chunking when uploading asynchronously?

To the best of my knowledge, no, the async-upload process on the WordPress side does not support chunking from plupload. You can find this code in /wp-admin/async-upload.php. To handle the uploaded file, it calls the wp_ajax_upload_attachment() function, in the ajax-actions.php file. This function refers directly to the PHP $_FILES array, meaning that the file would … Read more

limit number of post for achive page

You should use the pre_get_posts filter for this. For example, you could do this in your theme’s functions.php file: function limit_category_posts( $query ) { if ( $query->is_archive() ) { // Do not do this for the date or category archives. if ( $query->is_date() || $query->is_category() ) return $query; if ( $query->query_vars[‘cat’] == 8 ) { … Read more

Trouble in enquing all js files under certain directory

i think you’re putting too many extra bits on the file and path strings. try this : function _s_scripts() { $js_dir = get_template_directory_uri() . “/js/”; foreach(glob($js_dir.’*.*’) as $file) { $label = str_replace(“.”, “”, $file); wp_enqueue_script($label, $file , array(‘jquery’), ‘1.0.0’); } } add_action( ‘wp_enqueue_scripts’, ‘_s_scripts’ ); when I run a similar function locally against a dir, … Read more

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

I haven’t tested this, but this should work and don’t forget to replace the jQuery selector with your own: $(function() { if(typeof jQuery.datepicker === ‘function’){ $( “.your_date_picker_field_selector” ).datepicker({ beforeShowDay: function (t) { var e = t.getDay(); return [e == 3, “”] } }); } }); Updated: Since, you are using contact form 7 datepicker addon, … Read more

WP AJAX API with JS file

Currently I’m assuming that is is backend (front end is slightly different), but it’s very easy to implement on the frontend if required. You are correct in thinking that because you haven’t used the WordPress admin-ajax.php file, all the goodness of WordPress is missing. Fortunately this is easily fixed. Before continuing I recommend that you … Read more

Search query with Ajax

This is a javascript issue. You have to prevent form submission to stop the page from reloading. See event.preventDefault() in jQuery docs. jQuery(“#Submityourskill”).click(function(event){ event.preventDefault(); // the rest of your code });