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 Ted talk video using the shortcode:

[ted id=myid]

But it's not working. It shows the text instead of the video. Is there any configuration I need to check to make it work?

share|improve this question
3  
What plugin do you use for that? –  toscho Oct 10 '12 at 13:31
    
I followed the steps written here: en.support.wordpress.com/videos/ted-talks so i didn't install any plugin –  flero Oct 10 '12 at 15:11
add comment

2 Answers

up vote 4 down vote accepted

Unfortunately, this is going to be a problem for you.

The [ted] shortcode is specific to WordPress.com - not to a self-hosted site where you installed the software yourself from WordPress.org.

The only embeds that WordPress.org's software supports by default are listed in the Codex:

  • YouTube (only public videos and playlists - "unlisted" and "private" videos will not embed)
  • Vimeo
  • DailyMotion
  • blip.tv
  • Flickr (both videos and images)
  • Viddler
  • Hulu
  • Qik
  • Revision3
  • Scribd
  • Photobucket
  • PollDaddy
  • WordPress.tv (only VideoPress-type videos for the time being)
  • SmugMug (WordPress 3.0+)
  • FunnyOrDie.com (WordPress 3.0+)
  • Twitter (WordPress 3.4+)

There is a plugin available for embedding Ted talks, though. TEDTalks Embedder. But it only lists compatibility through WP 3.2.1, so it may not work with the current version (it may, but I can't guarantee it).


Alternative Actual Embeds

Here's an alternative if you don't want to use a plugin. Add the following to your theme's functions.php file:

// Whitelist the TEDTalks oEmbed URL
wp_oembed_add_provider( 'http://www.ted.com/talks/*', 'http://www.ted.com/talks/oembed.json' );

function ted_shortcode( $atts ) {
    // We need to use the WP_Embed class instance
    global $wp_embed;

    // The "id" parameter is required
    if ( empty($atts['id']) )
        return '';

    // Construct the TEDTalk URL
    $url = 'http://www.ted.com/talks/view/lang/eng/id/' . $atts['id'];

    // Run the URL through the  handler.
    // This handler handles calling the oEmbed class
    // and more importantly will also do the caching!
    return $wp_embed->shortcode( $atts, $url );
}
add_shortcode( 'ted', 'ted_shortcode' );

Now, you can embed TEDTalks two ways:

Enjoy!

share|improve this answer
    
Oh,ok! And yes TEDTalks Embedder does not work on my testing site ( WP 3.4 ) but it could work on the site i need it because it uses a lower version of WP. –  flero Oct 10 '12 at 15:32
    
If it doesn't, I've edited my answer to provide you a way to add the shortcode handler yourself by dropping some code in your theme's functions.php file ... oh, and I tested it to work on the latest version of WP. –  EAMann Oct 10 '12 at 16:12
    
Thanks - perfect! –  D. Lambert May 20 '13 at 18:48
add comment

The Jetpack plugin will allow you to use the [ted] shortcode on your WordPress self-hosted site.

share|improve this answer
add comment

protected by Community Sep 10 '13 at 7:18

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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