Skip to main content

Questions tagged [ajax]

Ajax - The core of WordPress uses Ajax only in the administration screens. For instance, Ajax is used for instant updates when you are doing comment moderation, and when you are adding and deleting items from lists such as categories, blogroll, and posts; Ajax is also the technology behind the auto-save functionality on post and page editing screens. Several themes and plugins also use Ajax; for instance, some post rating plugins.

1 vote
0 answers
13 views

Load More : Admin Ajax 400 Bad request, returning 0

I've been struggling to create a Load More button on a WP project. Basically, I use the Admin Ajax at our disposal when using WordPress. I also use the fetch API to communicate with it, via my load-...
1 vote
2 answers
2k views

AJAX not Working with php as supposed

I am creating a like system in PHP . My code looks like this . <?php class Like_System { private $userid; private $postid; private $user_ko_like_count; private $post_ko_like_count;...
0 votes
1 answer
1k views

admin ajax is not working for non logged in users

I know that this issue has been discussed many times, but I think I tried most of the advises. This is my code: $.post('<?php echo admin_url( 'admin-ajax.php' ) ?>', {'action': '...
0 votes
1 answer
2k views

Ajax the create and edit post form into lightbox and get results

So I have a Wordpress site I built that has custom post types and references to those post types inside others. Example: Custom Post Type 1 Custom Post Type 2 - References Type 1 on two fields Custom ...
0 votes
1 answer
2k views

wordpress ajax search posts

I tried to configure search area in wordpress using ajax, so i add this code into functions.php <?php // the ajax function add_action('wp_ajax_data_fetch' , 'data_fetch'); add_action('...
1 vote
5 answers
13k views

Ajax post returning full html page as response

I know that this has been frequently asked here, but none of the solutions I find seem to work for me. The issue is as follows: whenever I post the form, I have a console log with the response which ...
0 votes
1 answer
2k views

Change button text after ajax db update

I'm trying to learn serious php WP developing. My goal is to mark posts done/read on button click. I found this great ajax tutorial plugin. Here is the link of the tutorial, and for the plugin. I ...
3 votes
1 answer
1k views

Why does Wordpress Heartbeat login not refresh the nonces?

Here's an interesting experiment: Go to wordpress plugins listing page, notice the activate, deactivate links all have a nonce part in the request. In a second tab, log out of the site, and go back ...
0 votes
1 answer
1k views

Apply filters when loading post via ajax

Have been trying to solve this for couple of hours already. Here's the case: I'm making a plugin that separates the posts into pages using the <!--nextpage--> tag. It works fine but I want to ...
4 votes
1 answer
5k views

AJAX handler throws 400 (Bad request) - why?

I am trying to apply a "Load more posts" function to a post loop, but I am dealing with a 400 Bad request, when admin-ajax.php is referred to. The reference I used is this - https://rudrastyh.com/...
1 vote
1 answer
890 views

Help to upload post attachments from Ajax

My problem is that I cannot upload post attachments from a frontend form. I send data through AJAX to my php files containing functions. Let me be clear: everything is working great, the post is ...
0 votes
1 answer
1k views

ajax load more instead of pagination

<?php if ( ! defined( 'ABSPATH' ) ) { exit; } global $wp_rewrite; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $pagination = array( ...
0 votes
1 answer
2k views

Get ajaxForm response value

I have this ajaxForm: $('.simple-checkout').ajaxForm({ success: function (response) { console.log(response); alert("Success"); $('.cart-value').load(location.href); }, error: function (...
1 vote
2 answers
10k views

Dynamic dependent Dropdown lists for categories, sub-categories and posts

I'm using WordPress 3.5. I need a way to implement a code or plugin to allow users to navigate through posts using dependent(chained) dropdown lists. In other words I would like 3 dropdown menus to ...
0 votes
2 answers
2k views

Registration form not registering First and Last name

I'm creating a custom registration form which works using username and email inputs, but when I include First and Last name fields it won't let me register. Here is the form: <form id="...

15 30 50 per page
1
2 3 4 5
180