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 ...

learn more… | top users | synonyms

1
vote
1answer
25 views

Posting to admin-ajax from front end. Is this redirect ok?

I'm posting a form to admin-ajax and the redirect use to be within the success handler. That was taking too long to receive from the server then redirect, even though it was only a small json response ...
1
vote
0answers
13 views

Cannot update my options using wp_ajax

I have implemented wp_ajax in on my options page but the value of my options are not getting saved or updated. Here is my form: public function email_settings_form(){ // Set class property ...
0
votes
1answer
28 views

Passing form data via AJAX to REST API And displaying results

I'm new to WordPress but have been programming PHP for a long time... I searched a bunch of questions but couldn't find what I need. I have a page with a search form that contains a few parameters ...
0
votes
1answer
16 views

Loading post template that contains a nested loop with ajax

I'm currently working on a project where I'm loading a post with ajax. I'm using get_post() to get the post, setup_postdata() to setup the post data, and get_template_part() to load the template ...
0
votes
1answer
19 views

Can't load search results with ajax

I'm trying to load search results on my page without reloading. I tried multiple approaches already, but I still can't make it work, despite using someone else's confirmed solution. Please find the ...
0
votes
0answers
27 views

Category filter with load more ajax

What I am trying to do is to do an Ajax request to filter posts on category click depending on the category id, then apply load more posts by ajax. Problem: when I fire the ajax call by clicking on ...
0
votes
1answer
31 views

Allow user to Upload image and manipulate it on the frontend

The site I am working on allows users to post things up for sale. In the form for creating their post, there is a simple file upload field. The problem is that sometimes when users upload images they ...
-2
votes
1answer
27 views

How to get posts from external website with tags common using ajax Json? [closed]

Plzzz How to get posts from external website with tags common with current post using ajax Json and show it in my website.
0
votes
0answers
25 views

Is there a hack for using is_page() within the function.php file?

I've created a function in my functions.php that's called when the submit_form event is fired on the front-end. Here is the code: add_action( "wp_ajax_nopriv_submit_form", "submit_my_form" ); ...
0
votes
0answers
8 views

How to create a wordpress search with ajax with Relevanssi - A Better Search plugin

I am using Plugin Relevanssi - A Better Search for search with only words and phrases not only letters matching.And now need to change the search and create it with ajax but didnt know where to start, ...
0
votes
0answers
19 views

Woocommerce ajax checkout submit

So, in woocommerce, when a product is purchased, the user is redirected to "review-order" page. I am tying to make it so that the "review-order" page is instead shown by ajax on the product page ...
0
votes
0answers
29 views

ajax returns -1 in multisite sub domain

i am using the same theme for 2 language site - i didnt use a plugin but rather created a multisite (i like it better) - but... i have a problem with ajax which seems to work for main site but not ...
0
votes
0answers
27 views

Weird admin-ajax.php problem

In my site, each request on the home page is also making a POST to wp-admin/admin-ajax.php. 10.30.4.122 - - [21/Aug/2015:06:07:53 -0400] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 275 ...
1
vote
0answers
44 views

template_redirect or admin-ajax.php?

My plugin needs to be reachable by the public and accept query vars. When called, it will run some backend db tasks, call a 3rd party API and sometimes redirect. Previously, I was using ...
0
votes
1answer
30 views

First time doing Ajax with WP, how to do it?

I have been trying to work this out from various posts over the years but just can't seem to get it to work as I am not a Jquery guru and I am struggling to get my head around it. My html: ...
0
votes
0answers
9 views

Loading ajax does not run through filter the_content

I have created a quiz page with a list of question. I use ajax to load the question content into the quiz. However, only the first question which loaded directly (not through ajax) render correctly. ...
0
votes
1answer
35 views

Can't pass the variable from a select to PHP query

I'm trying to make a dependent drop down with AJAX. I managed to get the chosen variable but I can't pass it to the PHP. Here's my code: action.js window.onload = function($) { ...
0
votes
0answers
24 views

To get the data from the Database is not working?

The below code is reponsible to display a dropdown options that while selected a options a google map was appeared. But when I put the shortcode into my page the options are being shown. But the ...
0
votes
0answers
32 views

[jQuery]Autocomplete and $.post

I managed to solve it using Sisir's push in the right direction. Here's the javascript function: function render_edu_hook_javascript() { ?> <script type="text/javascript"> var ...
0
votes
2answers
35 views

wordpress ajax contact form - error 500

I've tried to create a simple ajax contact form plugin. all things seems good till user push the "send" btn. it sends error 500. this is my script.js codes: jQuery(document).ready(function(){ //Get ...
0
votes
0answers
37 views

Wordpress ajax load more returns duplicated posts

I'm trying to load more posts from my custom post type via ajax call, it sounds like i'm doing everything alright but one thing which is causing the duplication issue. My load more button does work ...
0
votes
0answers
48 views

WordPress AJAX File Upload - FrontEnd

So I have been reading through every WordPress front-end AJAX file upload tutorial I can fine. Nothing is working for me at the moment. The one that makes the most sense to me is this one: ...
0
votes
0answers
28 views

After wordpress widget save (ajax call) tinymce editor gone, data not saved

I have made tinymce editor for textarea fields in widgets. I'm enquing scripts: wp_enqueue_script('tinymce', home_url() . '/wp-includes/js/tinymce/tinymce.min.js'); wp_enqueue_script('tiny', ...
0
votes
1answer
42 views

I have to post data by AJAX in wordpress to another Website

I have to post data by AJAX in wordpress to another Website (http://123abc.com/register) .But I always get Error .This is my jquery AJAX code: <script> $(document).ready(function() { // ...
0
votes
0answers
22 views

Infinite scroll in ajax

So, I have ajax enabled on my wordpress site as following: id within any anchor within the chosen div will be saved and used to find an appropriate php file then loaded at an appropriate content div. ...
0
votes
0answers
21 views

Declare inline background image in functions.php

I'm not sure if this can be done as I cannot find anything to help me anywhere no matter how hard i try. I'm using Ajax to load to in posts on the press of the button. the posts that are loaded in are ...
0
votes
0answers
34 views

Modify category archive page loop on functions.php

I was able to modify the query on the category archive page using global $wp_query; $args = array_merge( $wp_query->query_vars, array( 'tax_query' => array( array( ...
0
votes
0answers
9 views

Create multiple Instances of Ajax function and Control Variables from Template file

I received some help previously in order to build a Wordpress Ajax Load more function, However the site I am building is using different variances of this on different pages pages. The issue I'm ...
0
votes
0answers
11 views

Sendy ajax subscribe call with json [migrated]

I am trying to get user to subscribe on the website using sendy subscription form (via ajax). The problem is it shows no error and console.log stuck with "signing in...". jQuery( document ...
2
votes
0answers
35 views

Initialize TinyMCE editor / visual editor after AJAX insert

I have a "repeater" style field group on a custom options page. There's an active visual editor in a hidden state, and when the user clicks "add new" the whole row is cloned. I then need to initialize ...
0
votes
1answer
30 views

wp_ajax is not calling the action

I am developing a plugin in which Ajax is not working. I'm using this code: add_action( 'wp_ajax_cpm_add_update', array( $this, 'edit_added_people' ) ); The edit_added_people() function is not ...
2
votes
3answers
59 views

Cannot access current post's ID in custom plugin

I have a plugin that prepends an upvote box to the_content of a single post, sends data via AJAX back to the main plugin PHP file and calls a function to update a database value on success. Here is ...
0
votes
0answers
26 views

Dislay Admin Notifications through Ajax

I am writing a plugin that will require its own settings page in the WordPress admin menu settings section. I have done most of it correctly, and I am stuck at one point. I understand that in order ...
-3
votes
0answers
45 views

Post rating without plugins?

Is there any simple post rating snippet which will work when page is cached. There is many functions, for example this: <form method='POST' action=""> <input type=hidden name=rate ...
0
votes
0answers
29 views

How to get query results for the next page

How to get query for posts from next and previous pages on Blog via ajax call? I'm thinking about making copy of the current query with offset like this: $curr_query = new WP_Query( array( ...
0
votes
1answer
44 views

Are innerHTML elements visible to jQuery functions?

For example, on my admin page i.e. dashboard side: //This is hidden until search results come back //which will be inserted as innerHTML within #searchResults <div id="hideShow"> ...
0
votes
0answers
20 views

Paginate Comments Via Ajax When Not On Parent Page

I have a page that I am using a custom query to pull in the comments from another post. The comments are successfully being rendered and formatted and the pagination links are showing up correctly as ...
1
vote
2answers
49 views

Click loads template via ajax

I'm trying to load a template via ajax if the user clicks on a button. This is the code I'm using: On functions.php: function phantom_scripts() { global $child_dir; /* Ajax Requests */ ...
0
votes
1answer
16 views

How to stop being directed to admin.php after sending request to admin-ajax.php

On my plugin admin page, I have make an ajax request to admin-ajax.php. For some reason, once the request is made, another request is made to admin.php which directs me away from my current page... ...
0
votes
0answers
39 views

Class is not supporting Ajax

I'm trying to make a plugin table which extends the existing WP_List_Table but I can't call my Ajax function with a hook: add_action( "wp_ajax_test_response", array( $this, "my_function" ) ); Here ...
1
vote
1answer
24 views

Is there a restriction in WP on the use of jQuery load function?

I'm just trying to load a simple txt file for testing purposes. jQuery(document).ready(function(){ jQuery("#buttonAjax").click(function(){ jQuery("#demo").load("demo.txt"); ...
0
votes
0answers
20 views

why is this ajax function not working as expected?

so my class looks like this: class Myclass{ private $nonce; public function __construct(){ if( get_current_screen()->id == 'nav-menus' ){ $this->nonce = ...
0
votes
2answers
44 views

Ajax contact form returnig 0

I have read through a lot of responses on this site and am unable to find the issue with my code. The form is : <?php while (have_posts()) : the_post()?> <form method='post' ...
0
votes
1answer
28 views

Display random text from a file with the WP built-in AJAX API

I want to use a solution by @toscho to display and rotate some quotes. The unchanged code works very well, but if I replace the protected function get_rand() { return rand( 1, 1000 ); } with ...
0
votes
0answers
10 views

Perform a 'refresh' transport or open the site in new tab, after saving the theme in Customizer

Is it possible to perform a 'refresh' transport after saving the theme in Customizer? Can you help me about this? If it is not, then my plan B is just to open the site in new tab after saving the ...
0
votes
0answers
26 views

How to solve this script problem in theme directory?

I have a jQuery Ajax call that calls a php script. This call works if the file is in the root of the site but does not work if this php script is in the theme folder . Additionally, I have a 500 error ...
0
votes
0answers
22 views

I' trying to display list of post and next and previous navigation for posts

using ajax in wordpress but i'm not able to get the same thing. here is my code this is my tag.php to display the posts " > <div class="post_text"> ...
0
votes
0answers
21 views

Strange AJAX problem (SOMETIMES works in Chrome/FF, ALWAYS works in Midori)

I have an ajax function that sometimes doesn't work in Chrome and Firefox (doesn't load the data), but displays no errors in the console. However, it ALWAYS works in the Midori browser (Bhodi distro). ...
0
votes
0answers
36 views

Ajax Vote Plugin e.preventDefault not working

I tried to build a plugin with which i can let users vote for articles so i can track kind of 'likes'. The Ajax works fine and I use a link as a trigger. Somehow every time I click on the link (which ...
0
votes
0answers
20 views

WordPress plugin returns 0 on admin page

I'm searching for an answer here for hours, and I can't find what's wrong with my code... my wordpress ajax keeps responding "0" no matter what I do... Here's the code: header.php file: ...