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)

Ajax page load in wordpress the right way?

Short answer: it’s not possible what you’re asking, in the right way. Because the DOM is changed, the elements that were removed had their events attached on them removed also, so you need to run that javascript again on the new elements. And if you have no control over those plugins and their javascript, then … Read more

Adding a jQuery modal dialog to the admin area

Don’t know if this could help you, I used this to manage a image field from a meta-box in the post admin page : add_action( ‘load-post.php’, ‘ImageOnSlider_scripts’ ); add_action( ‘load-post-new.php’, ‘ImageOnSlider_scripts’ ); function ImageOnSlider_scripts() { wp_enqueue_script(‘media-upload’); wp_enqueue_script(‘thickbox’); wp_register_script(‘my-upload’, WP_THEME_URL.’/js/name_of_script.js’, array(‘jquery’,’media-upload’,’thickbox’)); wp_enqueue_script(‘my-upload’); wp_enqueue_style(‘thickbox’); } and the JS : jQuery(document).ready(function() { jQuery(‘#upload_image_button’).click(function() { formfield = jQuery(‘#input-ImageOnSlider’).attr(‘name’); tb_show(”, … Read more

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