Posted By

leeboyce on 05/29/12


php field custom shortcode wordpres

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Execute Shortcode From Custom Field

 / Published in: PHP


This snippet will enable you to add shortcode to a wordpress custom field. Normally wordpress does not run shortcodes that you put into a custom field. Just put this code into whatever page you are displaying the results of the shortcode, and change the 'yourcustomfield_here' to the name of your custom field.

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

Report this snippet  

You need to login to post a comment.