Title: [Plugin: OptionTree] Support for php/shortcode
Last modified: August 20, 2016

---

# [Plugin: OptionTree] Support for php/shortcode

 *  Resolved [nlsubtitles](https://wordpress.org/support/users/nlsubtitles/)
 * (@nlsubtitles)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/)
 * Hi,
 * Been using the plugin for 2 weeks now and I really love it, it’s great for customizing
   themes in all kinds of ways!
 * I just tried to implement Adrotate via Optiontree Textarea_simple.
    The code 
   just displays on the site like text. I tried some things with return ot_get_option
   instead of echo but I can’t get it to work.
 * I think I can understand why it’s not working, the adrotate functionname is echoed
   and that’s it. It needs to read that line php a second time to actually run the
   function or something?
    Probably talking gibberish:D
 * So is there any way to get this to work?
 * [http://wordpress.org/extend/plugins/option-tree/](http://wordpress.org/extend/plugins/option-tree/)

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

 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/#post-2940014)
 * There is no support for php or shortcodes in the textarea. However, a quick fix
   for the shortcodes is to run the output of the textarea through the do_shortcode()
   function. PHP on the other hand is a much more complicated venture.
 * [http://codex.wordpress.org/Function_Reference/do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode)
 *  Thread Starter [nlsubtitles](https://wordpress.org/support/users/nlsubtitles/)
 * (@nlsubtitles)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/#post-2940025)
 * Works perfect! Thanks again Derek!!
 *  [davidjs](https://wordpress.org/support/users/davidjs/)
 * (@davidjs)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/#post-2940259)
 * Could you provide a php example of this. How do you merge a do shortcode and 
   an option tree function.
    <?php echo get_option_tree(‘frontpage_featurerow_text’);?
   > <?php echo do_shortcode( $frontpage_featurerow_text); ?>
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/#post-2940262)
 * First you would not echo it, you’d save it as a variable and then pass that to
   do_shortcode or something like this:
 * `<?php echo do_shortcode( get_option_tree( ‘frontpage_featurerow_text’ ) ); ?
   >
 * That should work. It’s not tested, but should anyhow.
 *  [patrickd@firebranddesigns.net](https://wordpress.org/support/users/patrickdfirebranddesignsnet/)
 * (@patrickdfirebranddesignsnet)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/#post-2940265)
 * This worked for me but with some issues. They may not have to do with Option 
   Tree but I hope someone can at least help me narrow down where the problem lies.
 * When I am _not_ logged in the content of the shortcode is only _sometimes_ displayed.
   Also, from that point down the document is not rendered! When I remove the shortcode
   from the option tree option field, the document fully renders when not logged
   in.

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

The topic ‘[Plugin: OptionTree] Support for php/shortcode’ is closed to new replies.

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

 * 5 replies
 * 4 participants
 * Last reply from: [patrickd@firebranddesigns.net](https://wordpress.org/support/users/patrickdfirebranddesignsnet/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/plugin-optiontree-support-for-phpshortcode/#post-2940265)
 * Status: resolved