Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to embed a Vimeo video into a post. I am inserting the URL into the page like so.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

http//vimeo.com/1234

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

It is outputted as the plain text URL. I have tried it with a youtube link and it worked perfectly. I have also tried wrapping it in the [embed] shortcode but that just wrapped it in anchor tags.

Any suggestions would be much appreciated, thanks.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

Looking into WordPress Core vimeo is registered like so:

'#http://(www\.)?vimeo\.com/.*#i'               => array( 'http://www.vimeo.com/api/oembed.{format}', true  ),

But looking at vimeo API for oEmbed they show their URL without the www. so what you need to do is register vimeo oEmbed correctly:

add_action('init', 'add_vimeo_oembed_correctly');
function add_vimeo_oembed_correctly() {
    wp_oembed_add_provider( '#http://(www\.)?vimeo\.com/.*#i', 'http://vimeo.com/api/oembed.{format}', true );
}

You can place this in your theme functions file or place in a plugin.

You may need to revisit posts that have vimeo embeds and resave after putting this fix in.

share|improve this answer
    
Thank you. I inserted it into my init hook and it worked perfectly. I did not have any previous embed links so I do not know if you have to click update on all of your posts. I would imagine it is a filter on echo, not on save. –  Wolfy87 Oct 13 '11 at 11:43
    
WP 3.3 Beta 1 works without the www. now. –  Jono Warren Oct 19 '11 at 9:09
add comment

I threw together a quick plugin version of this fix, which you can download from http://sct.temple.edu/blogs/it/2011/10/13/vimeo-embeds-issue-resolved/.

share|improve this answer
    
Already accepted the other answer, but you get an upvote anyway. Thanks! –  Wolfy87 Oct 14 '11 at 11:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.