Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
130 views

How to make this shortcode not refresh the whole page when i use it on frontend

everyone, I have this code that makes all the files in a folder visible and downloadable on the frontend through a shortcode. But I want to put it in Essential Addons' Advanced Tabs, and they don't ...
Maellion's user avatar
0 votes
1 answer
26 views

Update shortcode values using ajax call

I'm having a problem with a calendar, I've made a shortcode which returns events links in a grid that shows the current month view. I set $month_index in order to navigate through months (default is 0 ...
Enrico's user avatar
  • 11
1 vote
1 answer
366 views

How to handle Ajax Calls, when using same shortcodes (with different parameters, e.g. 'post-type')?

this is my very first question here. So please don't be too angry, if I miss something out or make mistakes while using the plattform. I was, of course, trying to find an answer on my problem first. ...
Diddi_83's user avatar
1 vote
0 answers
153 views

How to add AJAX in a custom PHP function using Google sheets API

I have followed a website link to fetch data from a SINGLE CELL of a Google sheet to a shortcode. And I am using that shortcode into the COUNTER widget in Elementor to achieve counting animation while ...
Zohaib Ahmed's user avatar
0 votes
1 answer
780 views

Short code template + ajax

I am doing a simple page that would work a single page inside Wordpress using Ajax. So to do this, I create a template page with a short-code in it. But the thing is that I really can't do ajax work ...
Marcos Felipe Donadeli Gonalez's user avatar
0 votes
2 answers
187 views

Render Modula Plugin Shortcode On Ajax Request

I am using Modula Plugin to speedup the galleries creation process. It works wonderfully but I don't understand how to render it correctly on the ajax call. I read through the available posts on ...
iuriiGav's user avatar
0 votes
1 answer
158 views

JS working when used normally but not in wordpress

I have a shortcode that prints a simple form, a button is used to submit the form. The problem is that when it's pressed, the form gets submitted normally, ignoring the js function. I can't understand ...
Kiro's user avatar
  • 1
1 vote
0 answers
137 views

AJAX and Shortcode with Parameters

I'm creating an ajax function which will display a filtered post. I used a shortcode to display the post. The shortcode has a parameter to filter its display. I have a category and a tag parameter. ...
Solenn2019's user avatar
0 votes
1 answer
1k views

Regenerating Wordpress shortcodes based on <select> value with AJAX

I'm trying to generate & replace Wordpress shortcodes with AJAX based on the user's chosen <select> option. I've posted my progress to date below - whilst the shortcodes are currently being ...
Graeme Bryson's user avatar
0 votes
1 answer
49 views

Why my Ajax events are no longer detected after dynamic change of shortcode content

I have two input select (dropdown) in the content of my shortcode. The first is created when initializing the shortcode content, while the second is created when the user chooses the value of the ...
Melinsuna's user avatar
  • 113
3 votes
1 answer
666 views

Custom Shortcode AJAX 400 Bad Request

I'm writing a custom shortcode that will need to call some PHP file via AJAX, after some user event. But I am getting Bad Request 400 as if my wp_ajax_* actions aren't being bound. Here is a simple ...
Harry Williams's user avatar
1 vote
1 answer
173 views

Different uniqid when calld in wp_localize_script and shortcode

So I am making a shortcode and trying to integrate vue + wp_query and having difficulty in making it work when I use multiple shortcodes on the same page with different attributes. I am using the code ...
shubhra's user avatar
  • 148
0 votes
0 answers
2k views

Offset with ajax load more posts duplicates

I have a shortcode that gets posts. I am using the shortcode three times on the page. The first time I grab the first 6 posts, the second time I offset by 6 and grab the next 4 posts, the third time I ...
Jason's user avatar
  • 205
0 votes
1 answer
263 views

Shortcode to pull posts

I need some help please. I have created a shortcode to pull in posts, then using ajax it loads more posts. I have everything working but it is duplicating the first group of posts. below is my code. ...
Jason's user avatar
  • 205
0 votes
1 answer
107 views

Remove a short code and update it's content (AJAX)

This is my code function ajax_layoutcontrol(){ if( !check_ajax_referer( 'special-string','security')){ return wp_send_json_error( 'Invalid nounce'); } if (! current_user_can('...
user avatar
2 votes
1 answer
6k views

wc_get_product in a none woocommerce page

I am creating a new shortcode in which I want to show some details about a product in a review-like page. If I got it right - I can only use wc_get_product if the current page is using the ...
Omer's user avatar
  • 149
0 votes
1 answer
656 views

Get shortcode attribute for AJAX call

I want to pass my plugin a folder where it can access files, so I can run multiple instances with different folders set. Adding an attribute with the folder name was my first thought. Because I'm ...
DevJoe's user avatar
  • 3
1 vote
1 answer
338 views

Get returned variable from a function to add_shortcode function

I'm passing successfully an ajax object to the backend following this (the script in the JS really it does not matters because I'm getting it well): add_action( 'wp_ajax_my_action', '...
dfrojas's user avatar
  • 113
1 vote
0 answers
24 views

Making sure that a plugin's scripts and stylesheets are included for dynamicaly loaded content

I'm currently making a theme that uses admin-ajax.php to dynamicaly load pages and posts. Some of this content uses plugins like final tiles gallery and Video Embed & Thumbnail Generator. If ...
Aymeric Bianco pelle's user avatar
0 votes
2 answers
290 views

Getting error on submitting form using Ajax with shortcode

I created a shortcode for user submission form. I want to submit this form without loading the page (Ajax). Here is my shortcode code add_shortcode('et-test-plugin_shortcode', function($atts, $...
Eh Jewel's user avatar
  • 855
0 votes
1 answer
4k views

How To Render Shortcode In AJAX Response?

Problem I have a one-page layout that displays an accordion looking WP menu of my page titles. I'm using AJAX to load and display the corresponding page's WP content into a div thats get's inserted ...
Aaron Lynch's user avatar
0 votes
1 answer
54 views

Cannot modify class property from shortcode handler function

I'm trying to store data from a shortcode attribute in a class property, so I can use it later in other functions. But somehow I'm always ending up with the initial value of the property. Here's a ...
Sven Chmielewski's user avatar
0 votes
1 answer
7k views

Use Contact Form 7 with Ajax

I made a plugin in wordpress for a form and ajax. When the page successful load the content via ajax, I want to use contact form 7 on the page. I use the do_shortcode() tag as explain on contact form ...
Amran's user avatar
  • 115
0 votes
1 answer
419 views

Use Shortcode on Custom Page

How can I use a shortcode on a custom page in a theme? Let say I have a page that has a jQuery ajax function. I am able to send the data via JQuery post on the my_form.php page. On the confirm.php ...
Amran's user avatar
  • 115
0 votes
0 answers
125 views

Do embed shortcode on wordpress ajax request

The plugin I'm editing currently includes WordPress via include("../wp-load.php") When I attempt to use do_shortcode, it parses out the embed shortcode without replacing it with the embed code. When ...
John's user avatar
  • 109
0 votes
0 answers
57 views

Ajax callback and shortcode functionality

I see that some people are having troubles using shortcodes in Ajax callbacks as apparently the Ajax instance is run in a different environment than usual. Advices are more than one, many of them ...
Riccardo's user avatar
  • 971
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 (...
JMDee's user avatar
  • 31
3 votes
2 answers
406 views

Calling shortcode in wp_localize_script strips result

I am working on adding some functionality on a Wordpress plugin which after a certain click needs to call on some shortcode through ajax. What I first attempted was to call the shortcode inside of ...
thairish's user avatar
  • 213
3 votes
2 answers
4k views

Shortcodes not resolved in AJAX call response

I have a simple function, which returns the content of a page with the given pageID: function get_page_content(){ $id = $_REQUEST['id']; $page_data = get_page($id); echo ...
Maximilian Körner's user avatar
0 votes
1 answer
2k views

Load next post by ID on a single page

I hope this topic is not duplicated. I see some similar topics but non of them can solve my problem, so I decided to put a new one. Here's the case. I have a single.php post with the defualt ...
Dimitrov's user avatar
0 votes
2 answers
4k views

plugin shortcode not working on ajax request call

I just bought the Visual Composer plugin from wpbakery, my problem is that I'm making ajax calls to get the content of posts that have been edited with Visual Composer when I get the data it only show ...
Efren Reyes's user avatar
2 votes
1 answer
2k views

Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]

What I eventually want to do is when user logged-in to the site, I want to redirect the to the page with all the post created by that user and I want to load them via AJAX request. I have save ...
Ohsik's user avatar
  • 407
0 votes
1 answer
3k views

AJAX and do_shortcode

I know questions on this subject have been asked before. But I'm stuck and cannot find a way out. I am using Ajax to load external information to my site. Initially all the information was loaded at ...
user2581369's user avatar
0 votes
1 answer
466 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 (...
Yuri's user avatar
  • 1,131
0 votes
2 answers
483 views

Ajax not returning anything on form submit

I am working in wordpress and on pressing the submit button I want the function to return result through ajax and result should be shown as an alert on the screen. But when I press submit nothing ...
Zeeshan's user avatar
  • 171
0 votes
1 answer
216 views

Access Shortcode in ajax code?

I have some data which is pulled over using ajax. Data works all fine, however, I have some shortcode been used in the same data which doesn't display as expected. It looks like shortcode function ...
Ghazanfar Mir's user avatar
-1 votes
1 answer
1k views

Why is my ajax live search not working when i use a shortcode to call it?

I've finally managed to get my live search in Wordpress working, but it only works when i directly call it in the class. I want to put it in a shortcode, so i can call it on every page i want. But ...
Reorganize's user avatar
3 votes
2 answers
8k views

How can I run shortcode after click with ajax

I have a little problem and need your help. I have tabs on my page and in one tab i have google maps. This tab is hidden by default and when i clik on it, i can see only small piece of maps. Map it is ...
Artus2000's user avatar
1 vote
0 answers
499 views

wp_editor in thickbox

I am updating a shortcode generator that I made before and I want to add in addition to text areas inputs etc.. a tinymce editor, so I call wp_editor in the ajax content of the thickbox, the editor ...
alialaa's user avatar
  • 11
1 vote
0 answers
892 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: ...
Robert Kazik's user avatar
1 vote
0 answers
1k views

do_shortcode via ajax

I try to call contact-form-7 via ajax with do_shortcode. But it shows just "shortcode code". function example_ajax_request() { // The $_REQUEST contains all the data sent via ajax if ( isset($...
kafaya's user avatar
  • 11
0 votes
1 answer
966 views

How to load a plugin when doing an Ajax call? [duplicate]

I have posted this question: How to use shortcodes on a widget sidebar when doing an ajax call?, with no answers. Now I want to ask a more specific question. The problem seems to be that the ...
Manolo's user avatar
  • 533
0 votes
0 answers
660 views

How to use shortcodes on a widget sidebar when doing an ajax call?

I'm trying to use a shortcode from Promotion Slider Plugin inside a widget when doing an ajax call. As said here, I could achieve it doing: add_action( 'init', function() { ...
Manolo's user avatar
  • 533
3 votes
1 answer
6k views

do_shortcode inside AJAX callback

I have an AJAX callback function inside my functions.php file, which displays posts in a specific category. add_action( 'wp_ajax_ajaxified_function', 'ajaxified_function' ); add_action( '...
MidhuN's user avatar
  • 507
3 votes
1 answer
22k views

Loading shortcode with ajax

I'm trying to load a slideshow if the browser is a certain screen size - i.e. I don't want the slideshow to load on smaller, mobile screens. The slideshow plugin provides a shortcode: <?php echo ...
Don't Wake Me Up's user avatar
0 votes
1 answer
1k views

load plugin with ajax [duplicate]

is there a way to load plugin with ajax? I want to load Quick Chat plugin which supports initializing with PHP and Shortcode [quick-chat height="400" room="default" userlist="1" userlist_position="...
CBeTJlu4ok's user avatar
2 votes
1 answer
1k views

Shortcode in AJAX popup

I am trying to use a shortcode from Ultimate Facebook plugin to display a FB connect button in an AJAX popup and can't seem to get it work properly. I searched and used the solution given by djb in ...
Ajay R's user avatar
  • 31
1 vote
2 answers
6k views

How to get gallery id inserted to a post?

Is it possible to get a specific Gallery ID inserted to a post in wordpress 3.5? I want to load gallery from post using Ajax. I use shortcode [gallery] to do it. But when I use it this way: echo ...
Paul's user avatar
  • 43
0 votes
1 answer
2k views

Pass data back to TinyMCE from Thickbox

I've added a shortcode button in the TinyMCE editor in the page/post pages that opens up a Thickbox form. The button is working; it opens up the thickbox form like it should. However my stumbling ...
Jiri Krewinkel's user avatar
0 votes
1 answer
1k views

AJAX function not working [closed]

One person on the site wrote a function, but I do not know why it works. This function displays a random quote. The functions implemented the ability to download new quotes via AJAX (link New Quote), ...
user23769's user avatar