Guys how to add your own jquery in wordpress???
-
can anyone help me how to add my own jquery function in wordpress?? actually i use this code to add my external jquery in wordpress
function li_addClass_js(){
wp_enqueue_script(‘addclass’,get_bloginfo(‘stylesheet_directory’) . ‘/js/li_addClass.js’, array(‘jquery’));
}
add_action(‘init’, li_addClass_js);and this function is working but i have problem when im try to test if this code really works. the content of li_addClass.js is
$(document).ready(function() {
$(‘.overview ul’).addClass(‘wawa’);
});
but the problem is not working even i try to test the alert(‘hello’); nothing happen i have basic background on jquery but i dont get it why in wordpress it not working… can you help me… ty
- The topic ‘Guys how to add your own jquery in wordpress???’ is closed to new replies.