display shortcodes outside of the_content

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.

1 Answer
1

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 ) );

Leave a Comment