Skip to content

Instantly share code, notes, and snippets.

@joshmcrty
Created July 18, 2013 18:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshmcrty/6031840 to your computer and use it in GitHub Desktop.
Save joshmcrty/6031840 to your computer and use it in GitHub Desktop.
Apply the WordPress content filters to a string of HTML from a custom field within the WordPress loop. The enables oEmbed, wp_texturize, etc.
<?php $my_custom_content = get_post_meta( $post->ID, 'my_custom_content_meta_key', true ); ?>
<?php if ( '' != $my_custom_content ) : ?>
<?php echo apply_filters( 'the_content', html_entity_decode( $my_custom_content ) ) ?>
<?php endif; ?>
@captainvn
Copy link

it work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment