Search input area autogrow – how?

they’re using CSS3 transitions. <style type=”text/css”> #s { float: right; -webkit-transition-duration: 400ms; -webkit-transition-property: width, background; -webkit-transition-timing-function: ease; -moz-transition-duration: 400ms; -moz-transition-property: width, background; -moz-transition-timing-function: ease; -o-transition-duration: 400ms; -o-transition-property: width, background; -o-transition-timing-function: ease; width: 72px; } #s:focus { background-color: #f9f9f9; width: 196px; } </style> <input type=”text” class=”field” name=”s” id=”s” placeholder=”Search”>

Properly embed javascript into WP (using function.php) – doesn’t work?

By default, the jQuery script is loaded in no conflict mode. I noticed that you have in you header.php the following code: <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/27986/<?php bloginfo(“template_directory’); ?>/js/jquery-1.4.2.min.js”></script> Adding jQuery like this, will override (if the page works) the wp_enqueue_script(‘jquery’). If you load jQuery like this, you need to activate the noConflict mode, as explained here. … Read more

Wp theme Jquery conflict with plugins that use jquery

WordPress jQuery automatically loads in noConflict mode with jQuery as the object ref. remove the hardcoded version of jQuery and try changing: $(document).ready(function(){ to: jQuery(document).ready(function($){ (note also the $ in function($))

How to change background image from WordPress Gallery

The background image is applied to the <body> element, so using jQuery, all you really need to do is add a .click() handler to the $(‘dt.gallery-icon img’) element, grabbing its src attribute and applying it to the body’s background-image. EDIT: I thought this would be an interesting exercise, so here is a plugin that does … Read more

Extend the twentyten dropdown menu with jQuery with a delay onmouseout

The solution was very simple! Just use Superfish.js as instructed on http://users.tpg.com.au/j_birch/plugins/superfish/#getting-started Be sure to include superfish, hoverIntent and jQuery in your wordpress. In your custom js script file, something like this works like a charm: $(‘ul#theidofyourmenu’).superfish({ delay: 600, // This will fire up the hoverIntent autoArrows: false // Disable this if you don’t want … Read more

registering new jQuery after wp_deregister_script() not working

When setting your dependencies they need to be in an array. wp_register_script(‘jquery’, ‘http://code.jquery.com/jquery-1.7.min.js’, ‘1.7’, 1); wp_register_script(‘modernizr’, get_bloginfo(‘template_directory’).’/js/libs/modernizr-2.0.6.min.js’, array(‘jquery’) ); wp_register_script(‘plugins’, get_bloginfo(‘template_directory’).’/js/plugins.js’, array(‘jquery’), ”, 1); wp_register_script(‘custom’, get_bloginfo(‘template_directory’).’/js/script.js’, array( ‘jquery’) , ”, 1);

making a plugin that moves other plugins wp_head actions to wp_footer

Remove the action, then add it back on a different hook. I think the only concern you could have with doing this is ensuring you do that late enough for the action to have been hooked, it should possible using the plugins_loaded hook(because that runs after plugins have loaded). add_action( ‘plugins_loaded’, ‘juggle_sharethis_action’ ); function juggle_sharethis_action() … Read more

Calling external Libraries in WordPress

In your functions.php add this code function load_custom_script() { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js’, false, ‘1.6.2’); wp_enqueue_script(‘jquery’); wp_register_script(‘jquery.flexslider’, get_bloginfo(‘template_directory’).’/jquery.flexslider-min.js’, array(‘jquery’)); wp_enqueue_script(‘jquery.flexslider’); } function load_custom_style() { wp_register_style(‘flexslider’, get_bloginfo(‘template_url’).’/flexslider.css’, array(), ”); wp_enqueue_style(‘flexslider’); } add_action(‘wp_print_scripts’, ‘load_custom_script’); add_action(‘wp_print_styles’, ‘load_custom_style’); Do not forget to remove your code <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js”></script> <link rel=”stylesheet” href=”<?php echo get_bloginfo(‘template_directory’); ?>/flexslider.css” type=”text/css” media=”screen” /> <script src=”<?php echo get_bloginfo(‘template_directory’); … Read more

Adding URL of PDF from Thickbox in a Meta Box

This line… imgurl = jQuery(‘img’,html).attr(‘src’); Means that jQuery is getting the “source” (i.e. full path) of the image. As you’ve guessed, that won’t work for a PDF file. What you’ll probably have to do is get the id of the attachment instead. Could you possibly update your original answer with the HTML SOURCE of the … Read more