Skip to content

Instantly share code, notes, and snippets.

@chasereeves
Created October 22, 2013 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasereeves/7093132 to your computer and use it in GitHub Desktop.
Save chasereeves/7093132 to your computer and use it in GitHub Desktop.
Wordpress shortcode for podcast file.
//=========================================================== PODLISTEN SHORTCODE
add_shortcode('podlisten', 'podlisten_shortcode');
// example: [podlisten src="http://your-site/videos/your-audio.mp3"]
function podlisten_shortcode($atts, $content = null) {
extract(shortcode_atts(array(
"src" => ''
), $atts));
return '
<hr class="big"/>
<p><strong style="letter-spacing:1px;font-size:.9em;">SUBSCRIBE IN iTUNES:</strong> Visit <a href="https://itunes.apple.com/us/podcast/fizzle-show-honest-online/id656726654">The Fizzle Show&rsquo;s iTunes page</a> and click &ldquo;Subscribe.&rdquo; <br/><span class="quiet"><em>(If that link takes you to another webpage, click the blue &ldquo;View in iTunes&rdquo; button.).</em></span></p>
<p><strong style="letter-spacing:1px;font-size:.9em;">SUBSCRIBE ELSEWHERE:</strong> &nbsp;Simply search for <em>&#8220;The Fizzle Show&#8221;</em> in your podcast app. Or click here for: &nbsp;<a href="http://www.stitcher.com/podcast/fizzlepodcast/the-fizzle-show">Stitcher</a> &nbsp; | &nbsp; <a href="podcast://fizzle.libsyn.com/rss">Instacast</a> &nbsp; | &nbsp; <a href="http://fizzle.libsyn.com/rss">Podcast Feed URL</a></p>
<div class="audio_element">
<audio src="'.$src.'" controls autobuffer preload="none">
<a href="'. $src . '">Listen to '. get_the_title() .'</a>
</audio>
<br/>
<em><small class="quiet">Download <a href="'. $src . '" target="_blank">'. get_the_title() .'</small></em></a>
</div>
<hr class="big"/>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment