Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
20 views

I want implement OTP SMS mobile verification in Wordpress with Ajax

I want implement OTP SMS mobile verification in Wordpress I want when send SMS to user, change view to another form and get user SMS My problem is when run ajax code it send SMS, but dosnt work ...
0
votes
1answer
19 views

Return custom product in ajax call loop

Working on Wordpress / Woocommerce architecture, I'm new in woocommerce, before i've worked on django and laravel framework, the project is a plugin wp, where a little form is fit with select tags ...
0
votes
0answers
12 views

Users not being redirected to homepage anymore. What happened here

Not sure what happened here, but i login to the frontend and click login, and it just sits there and the loading icon goes round and round, but nothing happens. However - it does log them in, but i ...
0
votes
1answer
18 views

wp_mail doesn't work when logged in?

I am having trouble with a wp_mail function I created, which sends an email when I press a button. It does work great when you do this logged out. But as soon as I am logged in it stops working. It is ...
0
votes
2answers
65 views

How to “Load More” posts via AJAX?

On the taxonomy-{name}.php template for my "Organisation" taxonomy, I am currently showing a limited number of posts, grouped for each term of taxonomy "Format". Where the number of available posts ...
0
votes
1answer
32 views

wp_query with ajax

I am trying to filter posts by year using WP_QUERY with AJAX And the current builder i am using is DIVI(for front end). Result Everything loads fine and i am facing one final roadblock that is when ...
0
votes
0answers
12 views

XT Woo Floating Cart refreshing on home page

Good day, I am using the plugin XT Woo Floating Cart and on archive page it is working well. But I need to put some products on the homepage and add the link to buy them. However I get a page ...
0
votes
2answers
28 views

Hiding load more button with wp ajax

im using ajax to load more posts for custom post type using WP QUERY, now i'm having trouble hiding button if it's last post or if there are no posts left ( behaviour im getting is when i click it ...
0
votes
2answers
17 views

Bad Request when adding new post via ajax form

I am trying to insert a new post with a simple ajax form in a wordpress plugin. Visitors will use this form to create posts from frontend. My form is like this: <script> jQuery( document )....
0
votes
1answer
26 views

How to Display Search Results with any Page/Post

I'm not really sure where I should ask this question so here I am. I have a website that is split into three parts from left to right: Menu (div name "sidebar"), Center Blue (div name "center"), and ...
1
vote
0answers
19 views

Extending wp JavaScript base class to make a post request to a custom REST endpoint

I've defined a REST endpoint /my-plugin/v1/post-read to show whether a post has been read or not, per-user. In PHP, my plugin keeps track of this depending on page views while logged in. I'm now ...
0
votes
1answer
29 views

Ajax is not working in a loop

I am trying to show data associated with selected categories by using ajax. Its working only for the last term selected, not for all the selected terms. Any help would be highly appreciated. var ...
0
votes
1answer
19 views

Wordpress ajax filter returning all posts when it should be filtering by category

Here is My code, it should be filtering by category, it displays all posts on any checkbox I click, I don't know how to fix this, I have tried everything. <form id="filter"> <?php ...
0
votes
1answer
11 views

Hide Load more Ajax button if there is no more users to load or less than the number?

How to hide the Load more Ajax button if there is no more users to load or less than the number <script type="text/javascript"> var ajaxurl = "<?php echo admin_url( 'admin-ajax.php' ); ?>"...
0
votes
2answers
15 views

How to show value using jqeury change methods after selecting value from two select options box? [on hold]

Jquery change will be executed only after selecting value from two select options. If I select one then it will show message as "Select two" or if I select two then it will show message as "Select Two"...
0
votes
1answer
14 views

Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)

I can't find the answer for my question anywhere. I am trying to make a login redirect script, after login the user (depending on their role) will go to a certain page. I have currently a working ...
0
votes
1answer
13 views

How to add loaded or spinner until a ajax request is not completed?

My ajax request works fine: <script type="text/javascript"> $('#submitBtn').on('click', function(evnt){ evnt.preventDefault(); var ajax_url = '<?php echo admin_url("admin-...
1
vote
2answers
96 views
+50

How to load custom post archives sub-pages with ajax?

I'd like to keep the pagination links for /page/2/, /page/373/, etc but instead of changing the URL on the browser i want everything to load on the archive main page. Ideally all those paginated URLs ...
-1
votes
0answers
15 views

php code inside jquery is not working [closed]

I try this very basic code to see if ajax works or not. $(document).ready(function () { var ajax_url = '<?php echo admin_url("admin-ajax.php"); ?>'; var data ={ action: '...
0
votes
0answers
11 views

Front End Ajax Pagination for users list inside author profile page

I really tired of being no one here answering me! I'm newbie with WP, And i'm trying to create an followers/following users list for our users inside their profile page with Ajax Pagination. The ...
0
votes
0answers
9 views

update custom taxonomy with Ajax in edit.php file

I created Custom Psot Type and Custom Taxonomy. I recover, for each CPT element its custom taxonomy. here is a screenshot: now , i want update the coustom taxonomy for the CPT element with ajax ...
0
votes
0answers
8 views

Search for custom post type with autocomplete not working

I have a custom post type of show and I am trying to create a search input where the following occurs: User can start typing a few letters and auto completed suggestions (based on the post title) ...
0
votes
0answers
11 views

Can I use NGINX to block access to wp-admin outside my intranet BUT allow AJAX to keep working? [closed]

From the access logs on my company's various websites, I can see that there is a constant stream of bots trying to access wp-admin and wp-login on every site. Luckily none of them are WordPress sites. ...
0
votes
0answers
11 views

Autosave for frontend editing

I have pages for draft posts, new posts, and all posts. I am using modified version of plugin Frontier Post. How can I have it to auto save the progress on a separate page (revisions page). This ...
0
votes
1answer
17 views

Performing ajax request in wordpress

I am trying to perform ajax request in my plugin. What I have done is: Class Someclass { public function __construct(){ } public function current_page_function(){ ...
0
votes
0answers
20 views

How to add Load more posts in category template

I want to add load more button for posts and limit the posts to 6 function cat_ajax_get(catID) { jQuery("a.ajax").removeClass("current"); jQuery("a.ajax").addClass("current"); ...
0
votes
0answers
14 views

Users list with Ajax Pagination inside each author profile for their follower and following users

I'm trying to create an followers/following users list for each user in their profile page with Ajax Pagination. Someone here was helped me to make the Ajax pagination working, but i'm facing a big ...
0
votes
1answer
11 views

Wp admin ajax load more

can someone explain to me how to include load more for archive, custom post type? I’ve been looking all over internet for a way to use it but can’t seem to find anything
0
votes
0answers
8 views

Ajax Search for Post titles Backend

I was making a plugin for my company and they have a weird demand. So, how can we do live search at the backend (not frontend) for all the topics? What I want is when someone types a word at Title ...
0
votes
1answer
19 views

wordpress dependent dropdownlist using post type is not working

wordpress dependent drop down list using post type is not working in ajax. I need a ddl value from another ddl in post type. i have 2 post type department and doctors, when i select a department in ...
0
votes
2answers
18 views

Get gallery in loop through ajax

So, calling this PHP from click through ajax I manage to display Title and content in my modal. But when the code gets to get_post_gallery it always returns null. $the_query = new WP_Query(array('p' ...
0
votes
0answers
23 views

Implement AJAX load more button in custom post loop

I need help implement a load more button in some custom loops in my custom wordpress theme. I'm experiencing some problems in the final step, I'm not able to print the function. This site is a ...
0
votes
1answer
23 views

Failed to load resource: the server responded with a status of 404 (Not Found) admin-ajax.php

Failed to load resource: the server responded with a status of 404 (Not Found) admin-ajax.php while insert image in to post, and when I add custom html widget in to side bar this error will appear....
0
votes
1answer
23 views

Display post after choice two taxonomy terms

I display post by a term filter (first taxonomy) and it works very well. I add an other list of terms filter (second taxonomy). I would like to display posts after choice a term in each taxonomy. ...
0
votes
0answers
36 views

Woocommerce Checkout page - Ajax refresh shipping cost [closed]

I'm using an API to calculate the shipping cost based on the user's location. The user fills in their location on a Google Places Autocomplete text input field. On filling in, the location's latitude ...
0
votes
0answers
6 views

create post usin rest API only after user have been registered and logged in via ajax returns 403 cookie nonce is invalid

I have a 3 step form and the last step is register or log in step. If the user is already logged in the third step is not shown to him and after second step the form will generate post using wp rest ...
0
votes
0answers
14 views

Top Authors list by highest post views with Ajax pagination

I'm trying to create an users list to sort all users by the highest post views for each user, I added $output = array_slice($topuser, 0, 10); to get 10 users when i click load more in the next page, ...
0
votes
0answers
18 views

Inserted data from database does not showing on front-page without referesh page?

What I want: I am building a simple gallery system plugin and uploading the images using AJAX so that the page does not referesh image insertion, deletion and displaying. Everything is fine with my ...
0
votes
1answer
46 views

Implementing an AJAX POST API call in wordpress

I'm attempting to make a POST request to an API. I've created a javascript file in my theme and i have tried two approaches so far: Approach 1: $.ajax({ headers:{ "Content-Type"...
0
votes
1answer
26 views

Using category and its sub-categories products attributes as filter in products pages

I have some categories and subcategories for each of them. And finally, some products under these subcategories. What I want is to choose some attributes of these categories and subcategories ...
1
vote
1answer
39 views

AJAX filter posts by year

So I have a HTML select form which allows users to choose years such as 2017 , 2018 etc Hence, what i want this to achieve is when user selects 2017 , the posts from 2017 will be loaded on the page. ...
0
votes
0answers
14 views

Ajax when click back on browser

Please hell me, I would like to do so after reloading ajax if I enter in product data then after clicking back in the browser I would like to bring ajax $.ajax({ url : ajax_url, type : 'POST'...
1
vote
1answer
46 views

Show special field when correct shipping is chosen

I tried this approach: add_action( 'woocommerce_review_order_before_payment', array( $this, 'my_custom_checkout_field') ); add_action('updated_checkout',array( $this, 'my_custom_checkout_field')); ...
0
votes
0answers
15 views

DIV isn't loading content from AJAX on my WordPress

I have a WordPress that I am setting up. The design calls for a list of titles, and when you click on the title, the post's content slides in from the right. I want to load the div with the post ...
0
votes
1answer
23 views

Can't publish post using ajax

I have an issue, i create three input in frontend(title, body, and name) I process the value using wp-ajax, and in my ajax function I use wp_insert_post to create a new post. if I put '...
3
votes
2answers
161 views

Are 'wp_ajax' and 'wp_ajax_nopriv' exclusive to authenticated and non-authenticated users?

Basically what I'm asking is, is wp_ajax_nopriv exclusive to non-logged-in users? Will a wp_ajax_nopriv action fire if a user is logged in?
0
votes
0answers
10 views

Wordpress ajax insert and delete if already inserted delete the post id stored in custom table

I am creating a wordpress ajax system to insert a post id. If the same post id was selected by logged in user then it wants to delete the particular id. For that i am creating a table like below it ...
0
votes
1answer
19 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('...
0
votes
0answers
11 views

How to set password protected cookie with ajax POST?

I've tried sending a post request to wp-login.php, but I'm getting a 406 error. I also tried copying the relevant parts of wp-login.php to my own script and sending the post there, but the cookie it ...
0
votes
1answer
54 views

While Ajax is working well, media upload isn't showing the imagines

Look at the image below, it has no javascript errors, and media upload still spinning forever :( I tried to install new Wordpress, also disabled all plugins, googled several times, I tried to do it ...