I have added a post with the post format of video and I am trying to get to video so I can display the video in one div and the text in another like
<div>the embedded video</div> <div>the content</div>
Is there a way in wordpress to do this?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Embeds are cached in hidden post meta fields with
_oembed_* keys. You could retrieve all of meta (with
get_post_custom() for example) and try to get info from it.
However, from quick look at my test data it seems that duplicates are not uncommon there (might have to do with either WP version changes or embed endpoint changes).
If you are not displaying this as "normal" content at all I would consider just adding custom metabox for video and its description.
Usually you just include the URL for the video on it's own line at the top of the post, then you add whatever content you'd like below it.
https://www.youtube.com/watch?v=1KkNeN3brMk <div>The content will follow the video and WordPress will automagically turn the URL into a video embed by using OEmbed.</div>