Title: Function will not run from widget text box
Last modified: August 19, 2016

---

# Function will not run from widget text box

 *  [bobjones](https://wordpress.org/support/users/bobjones/)
 * (@bobjones)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/function-will-not-run-from-widget-text-box/)
 * I’m trying to run simple functions as simple Text widgets to display archives
   or categories. But nothing will display on the blog.
 * For example, I selected an empty Text widget from Available Widgets and pasted
   in this function:
    `<?php wp_get_archives(); ?>`
 * But instead of displaying archives, the blog doesn’t show anything. I checked
   the source code and saw just a repeat of the function script:
    `<?php wp_get_archives();?
   >`
 * All my other widgets are working fine and functions run just fine in any non-
   widgetized areas of the blog.
 * Any idea how I can fix the problem?

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/function-will-not-run-from-widget-text-box/#post-2007659)
 * you need to use one of the php widget plugins:
 * [http://wordpress.org/extend/plugins/search.php?q=php+widget&sort=](http://wordpress.org/extend/plugins/search.php?q=php+widget&sort=)
 * or exec-php plugin
 * [http://wordpress.org/extend/plugins/search.php?q=exec+php&sort=](http://wordpress.org/extend/plugins/search.php?q=exec+php&sort=)
 *  Thread Starter [bobjones](https://wordpress.org/support/users/bobjones/)
 * (@bobjones)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/function-will-not-run-from-widget-text-box/#post-2007690)
 * Thanks so much, alchymyth. I suspect many others have wasted untold hours on 
   this problem and never found a solution.
 * The first two plugins I tried were broken, but otto’s PHP Code Widget is the 
   ticket:
 * [http://wordpress.org/extend/plugins/php-code-widget/](http://wordpress.org/extend/plugins/php-code-widget/)

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

The topic ‘Function will not run from widget text box’ is closed to new replies.

## Tags

 * [archives](https://wordpress.org/support/topic-tag/archives/)
 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [text widget](https://wordpress.org/support/topic-tag/text-widget/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [bobjones](https://wordpress.org/support/users/bobjones/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/function-will-not-run-from-widget-text-box/#post-2007690)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
