Need help with adding jQuery script to WP and calling script to page

i usally first deregister to avoid duplicates, then register it and enqueue it like so: function my_scripts_method() { wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js’); wp_enqueue_script( ‘jquery’ ); } add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’); Hope this helps, Sagive.

Change jQuery(document).ready to $.delegate in wordpress

Looks like you’re missing the jQuery ready function. Try this: jQuery(document).ready(function($){ $.delegate(‘p’,’mouseover’, function(e){ $(“#yyy a.tippy_link”).css(“background-color”,”yellow”); }); $.delegate(‘p’,’mouseout’, function(e){ $(“#yyy a.tippy_link”).css(“background-color”,”red”); }); }); Cheers,

Add text to metabox input text field from Thickbox

What your code in; jQuery(document).ready(function(){ // your code here… }); …and in fact your code should look like this; jQuery(document).ready(function($){ $(‘.insertdownload’).click(function(){ var did = ‘this is only a test’; did=did.replace(‘download-‘, ”); if ($(‘#format’).val(‘1’)) { $(‘#my_new_field’).val(‘[download id=”‘ + did + ‘” format=”‘ + $(‘#format’).val() + ‘”]’); } else { $(‘#my_new_field’).val(‘[download id=”‘ + did + ‘”]’); } … Read more

Add mark-up after/before link in wp_list_categories

one possibility – add a filter to functions.php of your theme: add_filter ( ‘wp_list_categories”https://wordpress.stackexchange.com/questions/58006/,”span_before_link_list_categories’ ); function span_before_link_list_categories( $list ) { $list = str_replace(‘<a href=”https://wordpress.stackexchange.com/questions/58006/,”<span>&#124;</span><a href=”,$list); return $list; }

wp_register_script Question

If you need to add it in the head, then this might help you: <?php add_action(‘wp_head’, ‘add_attr’); function add_attr(){ ?> <script data-cfasync=”false” type=”text/javascript” src=”http://use.typekit.com/YOUR-KIT-ID.js”></script> <script data-cfasync=”false” type=”text/javascript”>try{Typekit.load();}catch(e){}</script> <?php } ?> Make sure your theme has the wp_head function call. You’ll need wp_enqueue_scripts or wp_register_scripts only if your JS code in in some other .js file … Read more

jscrollpane problem with my child theme

i did it like that and its working now function kia_enqueue_scripts() { //use google’s jquery wp_deregister_script( ‘jquery’ ); wp_enqueue_script(‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js’); //load up your own plugin wp_enqueue_script(‘easing’, get_stylesheet_directory_uri() . ‘/js/jquery.easing.1.3.js’); wp_enqueue_script(‘custom’, get_stylesheet_directory_uri() . ‘/js/jquery.custom.js’); wp_enqueue_script(‘mousewheel’, get_stylesheet_directory_uri() . ‘/js/jquery.mousewheel.js’); wp_enqueue_script(‘jscrollpane’, get_stylesheet_directory_uri() . ‘/js/jquery.jscrollpane.js’); } add_action(‘wp_enqueue_scripts’, ‘kia_enqueue_scripts’);

Is it possible to append an external html file to my wordpress navigation?

I got this to work on a static html page. The problem seems to be the white space in the append. I also removed all the ‘\’ and changed append to use single quotes. Maybe a jQuery expert can enlighten us. (function() { $(‘#mainMenu ul li.page-item-13 a’).append(‘<div id=”megaMenuCopy”><h3>The Range</h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing … Read more