WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to display shortcode content outside of the_content?

I am building a custom theme who's theme options includes two text boxes that can be displayed on the front page. I want to be able to display shortcode content placed in these text box options. The theme uses files from the Options Framework.

share|improve this question
up vote 3 down vote accepted

You can use the function do_shortcode() for use shortcodes outside fomr default content. You can also parse this in your function, there get the output of your textfields, like the follow example for a custom field:

if ( get_post_meta( $post->ID, 'cfield', TRUE ) )
    echo do_shortcode( get_post_meta( $post->ID, 'cfield', $single = TRUE ) );
share|improve this answer
Thanks @bueltge. The shortcode is not part of a post. It is part of the theme options. – Steve Jan 13 '13 at 12:13
The function works in all fields, also in your theme options. – bueltge Jan 13 '13 at 13:06
@Steve, do_shortcode( get_option(etc... – brasofilo Jan 13 '13 at 14:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.