mwarner1
Member
Posted 3 months ago #
Great plugin. It looks like the only way to embed an audio player is via a post or page. Is there support for a function I could use in my theme files to embed the player? I'd like to be able to pull a URL to an mp3 file out of a custom field and enter that as an argument to a function. Thanks!
http://wordpress.org/extend/plugins/pb-oembed-html5-audio-with-cache-support/
PascalBajorat
Member
Plugin Author
Posted 3 months ago #
Hi,
yes that's no problem, here is my example code:
<?php
// http://codex.wordpress.org/Function_Reference/get_post_meta
$custom_field_mp3 = get_post_meta(get_the_ID(), 'mp3', true);
if( !empty( $custom_field_mp3 ) ):
// http://codex.wordpress.org/Function_Reference/do_shortcode
echo do_shortcode('[audio mp3="'.$custom_field_mp3.'"]');
endif;
?>
Please note: There is a new and important update out now v.2.2!
If you like the Plugin please rate it ;)
mwarner1
Member
Posted 3 months ago #