Ajax mousedown call getting “cancelled” when clicking link

It’s a good idea to prevent mixing your click/mouse handling. In the past when faced with the same problem, I’ve used one of two approaches (depending on my mood at the time): Mouseup Rather than use mousedown, use jQuery’s mouseup event. Mousedown is typically stepped on by click. By using mouseup instead, you fire your … Read more

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

Can not call .php files after switching to %postname%

What I assume is happening is when you are viewing a page with pretty permalinks, your relative URL breaks: submenu.php becomes http://yourdomain.com/pagename/submenu.php Try using .ajax instead: $.ajax({ type: “GET”, url: “http://localhost/submenu.php”, data: “cat=32” }).success(function(data) { $(‘#content’).html(data); }); This behavior wouldn’t happen using the standard URI query because no URI segments are added, therefore the browser … Read more

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

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

Custom loop attached to link

Something like this: Make an URL like /companies/?leaders Than in your archive template (top): if(isset($_GET[‘leaders’])) { global $query_string; $query_string = $query_string . ‘&meta_key=leaders&meta_value=yes’; query_posts($query_string); } Hope this helps.