Video embed screwing up post meta
-
Hey guys.
I have a question regarding a meta-data box I’ve created. It’s positioned next to the post image and has some information (location etc) about each project my client makes a post about, that anyone writing a post can add in the bottom, in custom fields.However, I’m building a child theme from the theme Tetris from WPExplorer (https://www.wpexplorer.com/tetris-wordpress-theme/) and when I post a video post, there is a link to the video in my fancy meta-data box, like so:
“wpex_post_video:
https://vimeo.com/xxxxx”Also, when editing the post, you can see it as a custom field. Deleting the custom field simply deletes the whole video embed from the post. I would very much want to hide this info, and since there isn’t really any support given for this theme on WPExplorer I thought I’d give it a go here.
I’m getting the meta info with “<?php the_meta(); ?>”.
In single.php:
// Video oEmbed if ( get_post_format() == 'video' ){ echo '<div id="post-video" class="fitvids">' . wp_oembed_get( get_post_meta( get_the_ID(), 'wpex_post_video', true ) ) . '</div>'; }
In content-video.php:
// Show video based on meta option echo wp_oembed_get( get_post_meta( get_the_ID(), 'wpex_post_video', true ) );
Any suggestions?
Thanks in advance
- The topic ‘Video embed screwing up post meta’ is closed to new replies.