WordPress automatically embeds a youtube video’s if I use:
http://www.youtube.com/watch?v=Xog1T5dUxcw [/embed ]
</code></pre>
<p>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:</p>
<pre><code><?php
$custom = get_post_custom($post->ID);
$url = $custom['_videoLink'][0];
?>
<div class="video">
<?php $url; ?>
</div>
How can I convert the Youtube URL into an embed URL using the standard WordPress function?