Enqueue Google CDN jQuery in Footer

The right hook The wp_default_scripts-hook only runs in the admin as it’s called by wp_default_scripts() on ~/wp-admin/load-scripts.php where it’s hooked at the end of the file. So to move jQuery in public to the footer, you have to use a different hook: wp_enqueue_scripts, which only runs in the public. No admin check needed. <?php defined( … Read more

Vimeo Froogaloop API, working in Fiddle but not WP

From: https://developer.vimeo.com/player/js-api#universal-event-spec If you’re embedding and controlling multiple players on a page or using our JS API library (Froogaloop), you should give each player a player_id that matches the id of the iframe element. http://player.vimeo.com/video/VIDEO_ID?api=1&player_id=vimeoplayer You may need to add the player_id query parameter to the src definition.

wpColorPicker: How update colors on input value update?

I was able to solve this by looking into the inner .iris() and check that it has a .(‘color’) method that allows to set a color at runtime. Thankfully, this .(‘color’) method is supported too by .wpColorPicker(), so one can do: var new_color = $the_related_field.val(); $the_colorpicker.wpColorpicker(‘color’, new_color); to overcome the annoyance of not having an … Read more

Creating multiple enclosing shortcodes and fixing JS issues on click

Code:- function more_shortcode( $atts , $content = null ){ return ‘<div id=”more-outer-‘.$atts[‘id’].'”><a href=”#” id=”more-link-‘.$atts[‘id’].'”>More</a><div id=”more-inner”>’. $content .'</div></div>’; } add_shortcode( ‘more’, ‘more_shortcode’ ); Usage:- [more id=’1′]This is one.[/more] [more id=’2′]This is two.[/more] [more id=’3′]This is three.[/more] Output:- <div id=”more-outer-1″><a href=”#” id=”more-link-1″>More</a><div id=”more-inner”>This is one.</div></div> <div id=”more-outer-2″><a href=”#” id=”more-link-2″>More</a><div id=”more-inner”>This is two.</div></div> <div id=”more-outer-3″><a href=”#” id=”more-link-3″>More</a><div id=”more-inner”>This … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)