Title: BUTTON TO CALL A PHP AJAXIZED FUNCTION
Last modified: August 30, 2016

---

# BUTTON TO CALL A PHP AJAXIZED FUNCTION

 *  Resolved [Enri](https://wordpress.org/support/users/enriqueerrando/)
 * (@enriqueerrando)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/button-to-call-a-php-ajaxized-function/)
 * Hi,
 * I’m not very good at coding, so I’m struggling a bit with this. I’ve tryed lots
   of suggestions out there, but cannot make it work.
 * THE GOAL:
    I want to create a button that when clicked calls a php function that
   executes without loading the whole page, just the code inside it. Everytime u
   click on that button again, that AJAXIZED function reloads.
 * THE ISSUE:
    The php function works, but I cannot make the button call that php
   function.
 * WHAT I’V GOT SO FAR (simplified):
 * I have a function that creates the button shortcode:
 *     ```
       function add_shortcode_button_function() {
       	/*I have tryed a bunch of things to create the button, but none have worked*/
       }
       add_shortcode( 'the_button_shortcode', 'add_shortcode_button_function' );
       ```
   
 * I have created the function with the AJAXIZED div:
 *     ```
       function ajaxized_function() {
       	echo '<div id="ajaxize_this:reloaded_content_function:xxxxxx></div>';
       }
       ```
   
 * I have created the function that loads inside the AJAXIZED div:
 *     ```
       function reloaded_content_function() {
       	echo 'The button has been clicked.';
       }
       ```
   
 * THE QUESTION:
    So the question would be, what should be the button code?
 * Thanks in adavnce!!!
 * [https://wordpress.org/plugins/ajaxize/](https://wordpress.org/plugins/ajaxize/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [yoav.aner](https://wordpress.org/support/users/yoavaner/)
 * (@yoavaner)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/button-to-call-a-php-ajaxized-function/#post-6726554)
 * Hi Enri,
 * Unfortunately Ajaxize wasn’t designed for your use case. It was created to be
   able to dynamically load code using a static html tag, primarily when pages are
   cached.
 * If you want to trigger a server function via a button click, then you’d need 
   to handle it with javascript on the frontend anyway, and once you do that, there’s
   very little value in using Ajaxize in the first place.
 * Unfortunately I can’t really help much. I suggest looking for other plugins or
   resources on how to use javascript to load dynamic content from wordpress.
 * Yoav
 *  Thread Starter [Enri](https://wordpress.org/support/users/enriqueerrando/)
 * (@enriqueerrando)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/button-to-call-a-php-ajaxized-function/#post-6726555)
 * Ok, thanks for the answer anyway, I appreciate u took the time 🙂
 * See ya!!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘BUTTON TO CALL A PHP AJAXIZED FUNCTION’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ajaxize.svg)
 * [Ajaxize](https://wordpress.org/plugins/ajaxize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajaxize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajaxize/)
 * [Active Topics](https://wordpress.org/support/plugin/ajaxize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajaxize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajaxize/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Enri](https://wordpress.org/support/users/enriqueerrando/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/button-to-call-a-php-ajaxized-function/#post-6726555)
 * Status: resolved