How to Run a jQuery Script after a Javascript Script has Finished in WordPress

To accomplish this, wrap wp_enqueue_script in a function and run it through the action hook wp_enqueue_scripts while using the ‘priority’ parameter available in add_action to set the load order. function these_go_first() { wp_enqueue_script(‘first_script’, ‘[path to file]/first.js’, array(‘jquery’), ‘1.0’ ); } function these_go_first() { wp_enqueue_script(‘after_script’, ‘[path to file]/after.js’, array(‘jquery’, ‘first_script’), ‘1.0’ ); } add_action(‘wp_enqueue_scripts’, ‘these_go_first’, 1); … Read more

How to install Lavalamp jQuery effect in wordpress [duplicate]

<script language=”javascript” type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/30944/wp-content/themes/metric /scripts/jquery-1.4.1.min.js”></script> <link rel=”stylesheet” href=”wp-content/themes/metric/lavalamp.css” type=”text/css” media=”screen” /> <script type=”text/javascript” src=”wp-content/themes/metric/scripts/jquery.easing.min.js”></script> <script type=”text/javascript” src=”wp-content/themes/metric/scripts/jquery.lavalamp.min.js”></script> <script type=”text/javascript”> jQuery(function() { jQuery(‘#nav’).lavaLamp({ fx: ‘backout’, speed: 700, click: function(event, menuItem) { return true; } }); }); </script>

Add jQuery function to media button

Where are you attaching this listener: $(‘#fluffyRabbit’).live(‘click’,function() { alert(‘o hai!’); }); I suppose that if you attach within a $(document).ready(function(){ //attach here $(‘#fluffyRabbit’).live(‘click’,function() { alert(‘o hai!’); }); }; that would do the trick. Is it working for you?

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 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

jQuery dialog prints HTML-Tags under WordPress

It’s sort of a longshot, but maybe try something like this: $(‘#button-setup-league’).click(function() { $( “#dialog p” ).html(‘<span>’+wpslm_v_script_vars.delete_league+'</span>’); $( “#dialog” ).dialog({ modal: true }); }); This, of course, requires “#dialog p” to be initially empty, or assumes that its contents can be replaced entirely. If not, maybe you can use the solution above but with a … Read more