I have a Custom Post Type that has several custom fields. One of the fields is multi-line and includes text with p tags.
When I view this field in the visual editor the p tags are all there.
I suspect the issue is how I am displaying the data in a custom template.
This is the code that I am using in the template to pull this particular custom field
<?php $key="story"; echo get_post_meta($post->ID, $key, true); ?>
Is it the get_post_meta that is stripping these tags or something else? If it is this what should I be using instead?
Thanks for any clues
Add this to your
functions.php
file:Then use this code to pull in the result:
Try this:
This should get your custom field and apply filters (with p tags)