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

0
votes
1answer
70 views

display user input using ajax in wordpress

I want to display user input with ajax . but still is executed function fail in js file. I dont know where the problem might be. I read http://codex.wordpress.org/AJAX_in_Plugins and I saw ...
0
votes
1answer
59 views

Fetching posts from wordpress function in ajax

I'm trying to fetch posts in ajax. Everything is working but It is showing only one post. Please check my code and tell me if something is wrong function ag_get_posts() { global $post; $args ...
0
votes
0answers
188 views

Can I make an ajax response cross-domain?

I am trying to make a single ajax response cross-domain. Is that possible? I tried something like this, but that did not work: function my_call_callback() { header("Access-Control-Allow-Origin: ...
0
votes
1answer
27 views

How to SELECT number from table and use in calculation . Unsupported operand types

This is the PHP part of an ajax request. The user enters two numbers, via two fields. I can add these two numbers together & display the total in a field, this works OK. However, I would also ...
0
votes
1answer
660 views

Wordpress plugin: admin-ajax.php not passing data to custom function

n this basic plugin skeleton, I am trying to get the data sent by ajax to wordpress admin-ajax.php to be processed by a custom function. It looks like the data send from the form does not reach my ...
0
votes
3answers
619 views

Wordpress plugin: render only page content using ajax call

I'm writing a plugins that renders json data from an API request and I need to implement an infinite scroll in a content page. The problem is when I render the content with an ajax call, it renders ...
0
votes
1answer
74 views

how to use get_field_name in external ajax handler

I am loading new form fields from Ajax when I click on radio button in my custom widget. In Ajax callback handler, I need to use get_field_name and get_field_id widget class methods. get_field_name ...
0
votes
1answer
97 views

Disable Ajax for Spiders

We have a site on wpegnine that gets about 20k visits a day and heavily depends on ajax for our inbound marketing strategy (lead/visitor processing). These ajax calls are killing our server ...
1
vote
0answers
289 views

jQuery and AJAX Not working with Select Form Element

I seem to be having a strange issue with jQuery and a newly-created AJAX form/function. I'm pretty new to AJAX so please bear with me. Here's the jQuery: ...
0
votes
0answers
62 views

SHORTINIT and sessions

Is it possible to use SHORTINIT for AJAX called php file and use a Wordpress shared $_SESSION global in it? I have this thus far: ini_set('html_errors', 0); define('SHORTINIT', true); require ...
1
vote
0answers
284 views

Stop auto load wp-admin admin-ajax.php

I have a multisite. I want to stop autoload wp-admin/admin-ajax.php. As I have search in google. I have found out option heartbeat. But it reduced the request. <?php add_action( 'init', ...
-1
votes
3answers
99 views

AJAX in wordpress theme loop

I'm trying to make a AJAX request on my theme. I already know wordpress handle AJAX very well, but not directly on theme file. It uses admin-ajax.php for this. I working on this for a long time and ...
2
votes
1answer
131 views

admin-ajax.php vs .load() in WordPress

I'm developing a theme and I want to ajaxify each internal link in my theme. Uptill now, i've used admin-ajax.php method successfully for these actions ... 1: Load More Posts for Blog with Ajax 2: ...
0
votes
1answer
305 views

is_singular() not working if called via callback function of admin-ajax.php

In my single.php I've some code like this ... if(is_singular('post')) { echo 'Blog'; } else { echo 'CPT'; } If I approach single.php from blog or CPT index page by using the_permalink(), ...
0
votes
0answers
12 views

Content not retrieving on .load jQuery function [duplicate]

I`m trying to get posts from a wordpress query_posts external php file via .load jquery function. I`m getting the correct html code, but the wordpress loop part of the code is not loading. My code ...
0
votes
1answer
75 views

Ajax, jQuery and Wordpress

I'm having trouble getting AJAX and jQuery to work with WP, and wondering if someone can point me in the right direction. I have a form, and I want to pass the data from the form to a PHP function, ...
0
votes
0answers
985 views

wp_query->max_num_pages always returns 0 on custom post type

Hi there I am developing a theme where I have to load some posts with ajax, in my index page everything works properly, the problem is when I need to use it on custom post type, I pass the values for ...
0
votes
0answers
26 views

Check for new posts in the loop every x mins/seconds

I'm trying to think of a way to check for new posts in the current loop (e.g. author, or tag) using ajax to give a live blog feel without reloading the whole page. Is it possible to 'fire' the loop ...
0
votes
1answer
89 views

Retrieve WordPress' the_content() with jQuery

I'm trying to load some additional images when the user clicks a button. At the moment, I have the following function: $('a').click(function(){ $( ".gallery-pop-up-container" ) .load( ...
-1
votes
1answer
42 views

Wordpress & Ajax

I'm creating a plugin and I want to implement drag & drop capabilities that save the order of li's in a list and then displays that list on the front end of the website. I may be a little over my ...
4
votes
2answers
251 views

How to process ajax requests correctly using ajax plugins

I've been stuck on this topic for a while. I followed Pippin's tutorial . According to a 2nd wordpress developer who I got advice from, this tutorial is now out of date/ not appropriate. He told me ...
0
votes
1answer
431 views

Using Jquery submit with ajax request

When the user clicks the 'submit' button on my form, I would like 'this will be echoed back' to be displayed within an alert. The only JS console error I get: Failed to load resource ...
0
votes
1answer
721 views

Uncaught ReferenceError: the_ajax_script is not defined . How is this not defined?

I'm using this example as a guide link to ajax example i'm using to my plugin example. I get Uncaught ReferenceError: the_ajax_script is not defined in the JS console . I've put my JS in the main php ...
2
votes
1answer
413 views

Wordpress Ajax Login without page reload

I'm currently developing a Wordpress theme where I want the user to be able to upload images before he register or log in to the site. The initial problem was, you can´t upload images to wordpress ...
0
votes
0answers
42 views

remove_action(“wp_ajax_function”, “function”); not working

I have the following code in a file called contact-form.php. The file lives here: wp-content/themes/NAMEOFTHEME/ (premium theme) function theme_contact_form() { // some code here (send mail when ...
0
votes
0answers
583 views

WordPress - admin-ajax.php returns 502 Bad Gateway

I'm getting a 502 Bad Gateway error for wp-admin/admin-ajax.php -- this is a WP site, hosted on WebFaction, which is using nginx. Where it most obviously crops up is when adding a new post or page, ...
1
vote
0answers
112 views

First Attempt at AJAX and it keeps getting Canceled. Can't Get Results to Show

This is my first attempt at Ajax. I've got it working in the fact that the database gets the record inserted properly, however, once that's done it won't return the response that I've set up. Its as ...
1
vote
1answer
2k views

Delete row of custom table in WordPress using AJAX

From my custom table ($table = $wpdb->prefix . 'user_req';) I'm showing data with $wpdb->get_results() and a foreach loop: I managed to update the database with the individual values from the ...
1
vote
3answers
1k views

Conditional success callback based on Ajax Response not working

I am trying to run an ajax request to pass some data to a function I have written. I return the response, and try and run some javascript based on the response, but it doesn't seem to be running ...
-3
votes
1answer
67 views

ajax for visitors wordpress

I have this code that does ajax in wordpress it is working fine in admin page but i want it work in the main page of my theme <?php add_action( 'admin_footer', 'my_action_javascript' ); ...
0
votes
0answers
455 views

Redirect all page templates to index.php and turning Wordpress into a Single Page Application CMS

I’m trying to push the boundaries of Wordpress by turning it into a SPA CMS. Everything works fine until now except for a redirection issue. github angularpresstheme How it works: When I create a ...
0
votes
0answers
329 views

List posts in a select tag and display the_content of the selected option

I would like to create a select tag with posts from my custom post type and then, when an option is selected, I need to get the_content() from that selected post by its ID and display the content ...
0
votes
1answer
361 views

insert query on a custom table using ajax with jQuery plugin Jeditable

I've read tons of post already but found no solution... I'm tryin to implement Jeditable functionality in a plugin with this code: jQuery(document).ready(function() { ...
0
votes
0answers
82 views

How to have post permalinks redirect to index.php with parameters for loading the content via AJAX?

That question is a bit of a mouthful, so allow me to elaborate: I'm using Wordpress as the CMS for a portfolio (each project is a post in the same category, 'work'). I'm displaying the posts using ...
0
votes
0answers
13 views

WP Nonce with Ajax- is it always neccessary? [duplicate]

I read, well, everywhere, that it is necessary to use the built in WP_Nonce feature when submitting AJAX requests. as such: wp_enqueue_script('my-ajax-request', plugin_dir_url(__FILE__) . ...
0
votes
0answers
107 views

Show different category galleries without page refresh using Galleriffic and Wordpress

I'm using Galleriffic in a WordPress site to display a gallery of images. The images belong in several different categories, and I want users to be able to filter by category via a submenu without the ...
1
vote
0answers
239 views

Shortcode in posts called by ajax is not working

I am using ajax to load content of post. Functions like the_title() works fine, but unfortunately the_content() doesn't returns any shordcodes( gallery nor tablepress ) data. here is my code: ...
0
votes
1answer
2k views

How to pass data parameter to ajax action function handler

I have the following js to process an ajax request: $('#someelement').click(function() { var cokeValue = 'coke'; var data = { action: 'load_post', ...
0
votes
0answers
48 views

Thumbnails to append content from database via ajax

Completely re-edited question: I am displaying music album covers as thumbnails in a page template. I would like to be able to click on an album thumbnail and pull the corresponding details for that ...
-1
votes
1answer
51 views

ajax response is 0 instead of 'script' [duplicate]

I keep getting a response of 0 instead of string, which is my function echoes. Why? code from functions.php // enque test.js function add_script() { wp_enqueue_script( 'test', ...
0
votes
0answers
142 views

TinyMCE in ajax modal window

I'm trying to use TinyMCE editor in fancybox ajax loaded (lightbox like modal window). I have managed to load it but i can't type in it and Text tab there are no quicktags buttons.. It respond on ...
0
votes
1answer
79 views

Localize script not working

I am testing ajax in wordpress, and it basically works but I do not want the url to be hardcoded, so I tried using wp_localize_script to get an object to use, but I get an error saying: ...
1
vote
2answers
267 views

redirect does not work in ajax function

I'm using ajax to post the form data. In the end I want to redirect to homepage. I'm trying following code, it does not work. It returns error 302. How can I redirect in the following function? ...
2
votes
1answer
59 views

Edit a different page in WP Customizer

I'm working with Customizer's incredible options, and so far so good, it's really powerful and does everything I want. However, I'd like to extend it, so instead of editing only the main page, I want ...
0
votes
0answers
56 views

retrieve data form wordpress into app problem with $.ajax access to an object

i'm working on my first app, based on my blog created with wordpress, anyway the problem is that i can't access to to different categories using json api. This my code: var requestData = { ...
-1
votes
1answer
1k views

Infinite Scroll applied to ajax loaded content

I'm doing a WP_Query on let's say page-a.php, that page has a div called target where page-b.php is being loaded into. Page-a is a custom template and page-b is an archive page. The structure on page ...
0
votes
0answers
393 views

Query multiple taxonomies plugin with ajax, archive loading posts outside filters

I have a custom post type called jobs and within I have several taxonomies: Job type (full-time, part-time, practice, etc), Country, Job Area (design, development, etc). I'm using the plugin from ...
0
votes
0answers
139 views

AJAX Pagination not working

I have integrated an AJAX Pagination in my site sidebar, where I'm showing custom post type. Here is my code: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $new_query = ...
0
votes
3answers
1k views

WooCommerce: Translation lost on AJAX call in Checkout page [closed]

I'm using WooCommerce for a site that I'm currently working on. And I'm creating it for a language other than English. I do the translations by means of the .po file. The issue that I'm encountering ...
0
votes
0answers
187 views

How to handle cookies from a WordPress plugin on a cached page?

I'm attempting to write a plugin that can work with cookies on a WordPress site that uses page caching (why?). I've been following this tutorial on Esanctuary.net. I'm trying to write to the ...