Override default jquery ui library with newer version

Add the following code in functions.php file of your theme that will remove default jquery ui core and will add your provided latest jquery ui core file from your theme. function my_scripts_method() { if(!is_admin()){ wp_deregister_script( ‘jquery-ui-core’ ); wp_enqueue_script(‘jquery-ui-core’, get_stylesheet_directory_uri().’/jquery.ui.core.min.js’, array(‘jquery’), ‘1.9.2’, 1 ); } } add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’); Tell me if it works for you or … Read more

Cancel jQuery ‘noConflict’ – is it really unsafe?

The problem with the $ alias is that a number of libraries quite puzzlingly decided to use the same variable as an alias. If two libraries try to use the same variable, one or the other will win and anything dependent on the other one will break. If you are only using jQuery, and never … Read more

Is it safe to include a javascript file in a template’s php file?

As @N00b mentioned Yes, it is safe adding a JS script as long as it doesn’t include any sensitive information. JS is fully exposed to client, you shouldn’t do it anyway. But your situtaion it is better to create a site specific custom plugin and add JS using it. Example : function themeslug_enqueue_style() { wp_enqueue_style( … Read more

WordPress ajax function parameter value not being passed

First of all you should read the codex on AJAX_in_Plugins Secondly you should look at wp_localize_script to get the value for the admin-ajax url to your javascript. $data = array( ‘ajax_url’ => admin_url( ‘admin-ajax.php’ ) ); wp_localize_script( ‘ajax-script’, ‘ajax_object’, $data ); In your javascript, you are then meant to reference the localized data jQuery(“.selectbox”).change(function(){ var … Read more

Jquery conflict

At least one issue I can see is that you’re including the jQuery framework at least twice. The first line <?php wp_enqueue_script(“jquery”); ?> Is the preferred method of including jQuery. Your installation of WordPress happens to include jQuery version 1.4.2. This allows good plugin and theme developers to leverage jQuery and not accidentally include it … Read more

jQuery breaking my wordpress site

You should not include jQuery manually. jQuery is included in WordPress by default, but isn’t loaded on every page unless a plugin or theme requests it. This can be done using: add_action(‘wp_enqueue_scripts’,’my_scripts’); function my_scripts() { wp_enqueue_script(‘jquery’); } Here is function reference for wp_enqueue_script (the function) and wp_enqueue_scripts (the action hook). In addition to that, WordPress … Read more

Showing Author Information and Latest Post by author in lightbox when clicked on the name of the author

You will want to implement that using AJAX. Read these two articles from the Codex for further information about integrating WordPress with some AJAX action: AJAX AJAX in Plugins Just to give you a head start, you will want something like this: Client-side (Javascript) $(element).click(function() { var data = { action: ‘get_author_info’, author_id: your-author-id }; … Read more