Title: Call function
Last modified: August 19, 2016

---

# Call function

 *  [deckster0](https://wordpress.org/support/users/deckster0/)
 * (@deckster0)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/call-function/)
 * Hi!
 * This is indeed a newbie question,
    how do I make a button that will “call/activate”
   a normal <?php func($args) ?> on click?
 * So it’s basically a button that will call the function and at the same time link
   to another page.

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

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/call-function/#post-1273944)
 * You have to use Javascript and possibly Ajax to call a PHP function while viewing
   a displayed page.
 * It is simpler if the function you want to run is called on the page you are linking
   to.
 * If you explain in more detail what you are trying to do I will try to offer a
   suggestion.
 *  Thread Starter [deckster0](https://wordpress.org/support/users/deckster0/)
 * (@deckster0)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/call-function/#post-1274188)
 * Here’s the code, which can basically explain everything.
 * I am using a plug-in named Theme switcher.
    It basically let’s visitors switch
   themes.
 * [http://wordpress.org/extend/plugins/theme-switcher/](http://wordpress.org/extend/plugins/theme-switcher/)
 * Using: <?php wp_theme_switcher(); ?>
    Will generate a list of link which will
   change theme on click. I just took the code and added it directly to the header(
   With some styling):
 *     ```
       <div class="templink">
       <a href="http://www.animebullet.com?wptheme=Animebullet Dark">
       <input type="submit" name="Whitetemp" value="Dark Theme" id="whitetemp" />
       </a>
       </div>
       ```
   
 * The problem is, when I want to change theme, it just won’t work because of the
   cache. So I want to create a “button” which will clear the cache and at the same
   time change theme.
 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/call-function/#post-1274209)
 * I suggest you ask this question of the plugin developer, here
    [http://ilfilosofo.com/forum/](http://ilfilosofo.com/forum/)
 * He will probably help you. If you get a solution you might post it back here 
   so others can try it also.

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

The topic ‘Call function’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [tag](https://wordpress.org/support/topic-tag/tag/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/call-function/#post-1274209)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
