How to use JQuery Marquee in WordPress?

WordPress comes with copy of jQuery bundled. See wp_enqueue_script() documentation for how to: Register you script properly and make it load jQuery as dependency Use required noConflict wrapper so you can use jQUery functions (simply $ won’t work in WP).

AJAX calendar navigation returns -1

Echo your output in your AJAX callback function Exit PHP after you echo your output using exit; Since you’ve localized the ajaxurl variable, use it in your AJAX request Pass action : ‘my_special_action’ into your AJAX request Whatever action you use, use the same for both nopriv and normal AJAX hooks Here’s how your AJAX … Read more

How to wrap posts into divs?

I think this is probably a more-involved question, but I’ll try to answer it as-is. The following code will wrap each post’s content in a <div>: <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div id=”slide<?php the_ID(); ?>> // Post content – i.e. your slider image – goes here </div> <?php endwhile; … Read more

Jquery not working

Are you sure the jQuery library is loaded on your page? The error you’re getting implies it isn’t. View the source and search for jQuery. Then try adding this some where in your functions.php (or plugin) file and see if your script works. <?php add_action( ‘wp_enqueue_scripts’, ‘wpse30127_enqueue’ ); function wpse30127_enqueue() { wp_enqueue_script( ‘jquery’ ); }

How to load previous or next attachment with jquery ?

@milo thanks ! i used a technique found on the page you sent. it’s almost working. I added this at the end of the previous single.php code : array_unshift($attachments_list,””); wp_enqueue_script(‘myscript’); wp_localize_script(‘myscript’, ‘attachments_list’, $attachments_list); To work, this code must be called before wp_head(). Then, for a mysterious reason, the first element (with the index 0) is … Read more

Determine image height within Fancybox

Finally I came up with the solution to retrieve the image height using PHP getimagesize() and printing it as the ID of the image. Later, in JS I used: var contentheight = jQuery(‘.fluidimage’).attr(‘id’); to retrieve the height and perform the necessary action. Here’s the PHP code: <?php $imageurl = $pathtoimage; $image_size = getimagesize($imageurl); $image_height = … Read more

Jquery checkbox -show posts with checked tags

Grab and go, buddy! Had fun figuring this one out 🙂 Create a file and upload to your plugins. Call list_ajax_tags() in theme where you want to display these tags. Modify to suit your needs http://pastebin.com/3eZWEv5K (had trouble formatting the code here)