Support » Plugin: WP RSS Fetcher ShortCode » Adding Audio support

  • notdodgy


    First – thanks for the plugin, neat and effective.

    I needed to add a feature…
    I use an rss feed from
    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;

  • The topic ‘Adding Audio support’ is closed to new replies.