and like us on FB

Yahoo! News originated as an internet-based news aggregator by Yahoo!. By 2011, however, Yahoo had expanded its focus to include original content, as part of its plans to become a major media organization. Integrating veteran journalists such as Walter Shapiro, Virginia Heffernan, and Katie Couric has slowly given the service more credibility than it originally deserved. According to Alexa , the site currently sits in 12th position for news consumption – ahead of the likes of FOX, Bloomberg, Reuters, WSJ, and others.

The WordPress function on this page will permit you to embed responsive Yahoo! News videos into your WP post or page with shortcode. We’ve also provided a PHP function for use outside of WordPress.

The function may work on Yahoo! videos other than news videos but we’ve found their platform to be notoriously unreliable.

The Result

The shortcode of [yahoonews v="http://news.yahoo.com/video/yahoo-news-live-ben-carson-182500280.html"] will render the following video :

Available attributes are v (the full video URL), and width. The height will automatically be determined.

WordPress Shortcode

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

PHP Function

The following function may be used outside of WordPress. Not unlike the WP version, the video will be responsive.

Considerations

  • When pasting video URLs into the shortcode, try and remove everything after the .html. This accounts for URL structures we haven’t seen.

Download

Title: Embed Yahoo! News Videos With PHP or WordPress Shortcode
Description: Displays responsive Yahoo! News videos in WordPress with shortcode.
Download: Shortcode (V0.1) | WP Plugin (V0.1) | PHP Code (V0.1)

Shortt URL for this post: http://shor.tt/2GFB