Support » Plugins » short code as custom field value input

  • Resolved tronicscribe


    I need to make a custom field to display something outside of the_content (but still inside the loop), however this thing I need to display is the form generated by the contact form 7 plugin, which requires the insertion of its short code into the post area.

    I thought I could simply put that short code in my custom field’s value area and be done with it. However it doesn’t look like custom field values allow short code, since all that showed up on the page was the short code itself, not it’s generated contact form.

    Is there any way to use short code in a custom field value? Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Anyone know how to make this work?

    This should do the trick:

    <?php echo apply_filters('the_content', get_post_meta($post->ID, 'your_custom_field_here', true)); ?>

    Thank you very much. that worked well. I’m guessing that “apply_filters” does all the work, because it looks like the rest is just the standard way to show a custom field. Is this correct? Thanks again 🙂

    Hi, this may be a stupid question but where do you insert the code so that it works?



    @ indiesophical

    I had the same problem, but figured it out. You have to put it inside the loop but wrapped in different div’s than the the_content. That worked for me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘short code as custom field value input’ is closed to new replies.