Use Jquery with wordpress
How to use jQuery with Wordpress plugin?
My code:
require_once("view.php");
add_filter('the_content', 'test');
add_action('wp_head', 开发者_开发百科'ss_load_script');
add_action('wp_footer','display_copyright');
function ss_load_script(){
wp_enqueue_script('jquery_new', get_bloginfo('url')."/wp-content/plugins/Test/jquery_new.js", array(), '', true);
}
Wordpress already loads jquery: if you are trying to load a DIFFERENT version of jQuery you might end up having conflict issues between the standard version and your version.
If you need jQuery just use the default jQuery library that Wordpress loads. Otherwise you will either overwrite the existing jQuery library (which could probably work out fine for you: your code above would work) or you have to do some javascript magic to copy the existing jquery to another object before you load your new copy and then restore it after you're done.
精彩评论