Issue displaying video from custom meta
-
I am having an issue displaying locally hosted video and youtube/vimeo videos from a custom meta field. I was originally using
<?php echo apply_filters(‘the_content’ get_post_meta($post->ID, 'video_field', true)); ?>
It works great for outputting the videos, however this breaks many plugins due to the_content call. My page builder for example doesn’t display in the correct area due to this call (Same with social sharing links and a few other plugins).
I also tried creating a custom apply_filters call but it didn’t seem to work either. Perhaps I’m missing some filter?
Lastly, I also tried using
<?php echo wp_oembed_get(get_post_meta($post->ID, 'video_field', true) ); ?>
This works great for oembeds like youtube and vimeo. However it does NOT work for locally hosted videos.
Any solution for displaying locally hosted videos AND youtube/vimeo from a custom meta field?
- The topic ‘Issue displaying video from custom meta’ is closed to new replies.