I'm hoping someone might be able to help me.

I'm using the Options Framework Plugin to customise my site, but I'm having difficulty with using a shortcode in one of the custom fields.

I've created an 'editor' field, and called it in my theme like so:

  if ( of_get_option('footer_contact_form') ) {
    echo of_get_option('footer_contact_form');

But it outputs the shortcode (gravity forms) as raw text, like so: https://dl.dropboxusercontent.com/u/4676147/shortcode-output.png

Is it possible to achieve what I'm trying, or will I have to hard code the form into the theme?

Many thanks in advance!

1 Answer 1


You should check out the WordPress function do_shortcode().

You can use it to generate the shortcodes, in a string variable, like this :

<?php echo do_shortcode( $content ) ?>

So in your case, please try:

  if ( of_get_option('footer_contact_form') ) {
      echo do_shortcode( of_get_option('footer_contact_form') ); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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