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
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="...
0 votes
1 answer
687 views

Ajax a php file that has Advanced Custom Fields in it

I am trying to AJAX in a php file that uses Advanced Custom Fields fields, and get a 500 internal error when making the request. The php file works fine if I just use ‘include’, but I need to have it ...
2 votes
1 answer
3k views

how load content as pop-up using ajax

There's a way to use ajax to load the content from single.php or a custom .php like ajax-single.php like this page does it: https://yellowimages.com/all/objects/apparel-mockups/ also like them show ...
0 votes
2 answers
5k views

Filter posts by categories ajax is showing all the posts

i'm try to filter posts by an cascade dropdown categories. But when i select an option of the cascade, he showing all the posts. How can i filter ONLY posts through the selected option? This is my ...
8 votes
5 answers
6k views

is_admin() returns true when using admin-ajax.php from front end script

Had a situation today where I was using admin-ajax.php from a front end script. As I understand it this the wp way to make ajax calls (registering my function with the wp_ajax_nopriv_myfunction hook) ...
0 votes
1 answer
2k views

Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin

I have a custom plugin with the following code add_action( 'init', 'my_script_enqueuer' ); function my_script_enqueuer() { wp_register_script( "gift_card_redeem", WP_PLUGIN_URL.'/plugin-...
1 vote
1 answer
1k views

Ajax category filtering products default show all

I have code that list categories and products by category. When I click "All" it list all products, but when I go /products page it's not list all products by default and I need to click &...
0 votes
1 answer
1k views

How can I create a button that when clicked populates a div with a list of foods that are checked as a certain type of ACF?

I have not asked any questions here before so I'm sorry if I do it wrong. I am new to custom theme template files. I am new to wordpress and php also. This is a learning exercise for me. I am making a ...
3 votes
1 answer
2k views

Shortcodes not working in an AJAX call

I am using AJAX to load next set of posts on homepage. The posts load fine but the shortcodes are not rendered. I am trying to use the do_shortcode function on the content the ajax call fetches (...
0 votes
1 answer
2k views

AJAX login without a plugin does not work. when add a action to function.php

I am using wordpress ajax login without a plugin. I want to not be allowed users access to the WordPress profile after login, Because i have designed a specific profile in the link: http://www....
0 votes
1 answer
721 views

Pass the updated value of aid from form using ajax

I am working in wordpress and I want to fetch the updated value of aid field from form each time a submit button is pressed. There are two submit buttons and I want the id as per the clicked row HTML ...

15 30 50 per page