WordPress automatically embeds a youtube video's if I use:
[embed] http://www.youtube.com/watch?v=Xog1T5dUxcw [/embed ]
This is great, but it doesn't work if I use it in a template file. I have a custom field where the admin can put a URL to a YouTube video. I want to get the video in the single-post using the following code:
<?php
$custom = get_post_custom($post->ID);
$url = $custom['_videoLink'][0];
?>
<div class="video">
[embed]<?php $url; ?>[/embed]
</div>
How can I convert the Youtube URL into an embed URL using the standard WordPress [embed] function?