Whenever you try to display a shortcode through custom field you will get the text part and the shortcode function won’t be trigger. To avoid this you can apply the following filter in your code:
1 |
<?php echo apply_filters(‘the_content’, get_post_meta($post–>ID, ‘the_custom_field’, true)); ?> |
“the_custom_field” should be replaced by your own custom field name.
Basically you can apply this filter to any kind of custom content: metaboxes, custom fields and so on.
1 |
<?php echo apply_filters(‘the_content’, $your_contnet); ?> |