Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I recently downloaded a free plugin from wordpress.I want to remove the plugin from loading jQuery because you experts know that it is already loading from wordpress header.php file.

The plugin is testimonial-slider

How to edit the plugin to prevent it from loading jQuery?

I tried other methods like enqueue scrips, but cannot find success.Now I'm planning to edit this plugin, can anyone guide me?

thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If a plugin is written well (or the theme) than you have no reason to worry about duplicate jquery loading.

if your theme uses header.php to load jquery then your doing it wrong and should use enqueue scripts to load jQuery...

Wordpress uses wp enqueue script to declare scripts once and not multiple times.

Example of loading scripts the right way:

function sg_theme_js(){

    wp_enqueue_script( 'jquery' );
    wp_enqueue_script( 'bootstrap', 'http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js', array('jquery'), 3.3, true);
    wp_enqueue_script( 'miscscripts', get_template_directory_uri().'/js/misc-scripts.js', array('jquery'), 1.0, true);

}
add_action( 'wp_enqueue_scripts', 'sg_theme_js' );

Also...
i have downloaded the plugin and found where scripts are being loaded (in testimonial_1.php) and the plugin doesnt load jquery - i guess the author assumes your theme includes jquery correctly (as it should)

SO...
i would search for the spot you include jquery in your theme and change the way to do that to the right way AKA using the wp_enqueue_script function

share|improve this answer
    
Thanks for your support.I'm not expert in coding so it seems to be difficult to work with enqueue code. can you help me here wordpress.stackexchange.com/questions/154191/… –  Vijitha Stephy Jul 11 at 6:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.