In WordPress, how can I use the embed video feature via a custom shortcode?
I have tried the following, but that does not actually embed the video. It just adds an empty <div class="aligncenter"></div> to the html?
function shortcode_vimeo($atts) {
extract(shortcode_atts(array(
"id" => '',
"align" => 'aligncenter'
), $atts));
return '<div class="'.$align.'">' .
do_shortcode('http://www.vimeo.com/'.$id.'')
.'</div>';
}
add_shortcode("vimeo", "shortcode_vimeo");
Embedding videos seems to not work with
do_shortcode. However, I have now found the following solution: