WordPress.org

Ready to get started?Download WordPress

Forums

WP RSS Fetcher ShortCode
Adding Audio support (1 post)

  1. notdodgy
    Member
    Posted 1 year ago #

    First - thanks for the plugin, neat and effective.

    I needed to add a feature...
    I use an rss feed from sermon.net.
    The feed items are links to mp3 or pdf files.

    I modified the code as below to add the html5 code to get the users browser to insert an audio player.

    This could be a useful feature to include in a future version, so that it adds the option to play podcasts etc.

    foreach($items as $item)
    	{
            $str .= '<li><a href="'.htmlspecialchars($item['link']).'" title="'.htmlspecialchars($item['title']).'">'.short_name_custom( htmlspecialchars($item['title']), $words_limit ).'</a>';
    /added code
    	if ( strpos($item['link'],'mp3') !== false)
    $str .= '<br/> Play: <audio controls="controls"><source src="'.esc_url( $item['link'] ).'" type="audio/mp3" /></audio>';
            $str .= '</li>';
    	}
    /end of added code
    	$str .= '</ul>';
    		return $str;

    http://wordpress.org/extend/plugins/wp-rss-fetcher-shortcode/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic