function create_player(){
//Use this function to insert the Powerpress player anywhere in the page.
//Made by Nicolas Bouliane (http://nicolasbouliane.com/)
/*We're going to use the Loop to retrieve the latest post with the 'enclosure' custom key set
//then interpret it and manually launch powerpressplayer_build with the URL contained within
//that data.*/
//Let's reset the Loop to make sure we look through all posts
rewind_posts();
//Loop through each post
while (have_posts()) : the_post();
//Check if there are custom keys for this post
if( get_post_custom($post->ID)){
//Check the record for the 'enclosure' key
$meta = get_post_custom($post->ID);
if(isset($meta['enclosure'][0])){
//Split it as to retrieve what matters most: the file URL which should be on the
//first line (I didn't test much)
$url = split("n",$meta['enclosure'][0],2);
$url = $url[0];
//Create a player and end the loop. That was easy!
$Settings = get_option('powerpress_general');
echo(powerpressplayer_build( $url, $Settings, $ExtraData ));
break;
}
}
endwhile;
/*Reset the loop again in case this code ends up in the header. Otherwise, the posts would
//start from the first podcast that was found.*/
rewind_posts();
}