Only display custom field if present and add content filters
-
Hi all,
I’m trying to display the contents of a custom field with auto p tags if the content field has been added. So far I have this but it doesn’t work, can anyone help with what I’m doing wrong please?
<?php if ( get_post_meta($post->ID, 'credits', true) ) : ?> <aside class="credits"> <?php echo apply_filters('the_content', $credits); ?> </aside> <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Only display custom field if present and add content filters’ is closed to new replies.