[Plugin: Audio Player] accessing audioplayer with do_shortcode() only printing text
-
I have a custom field, we’ll call it cd_mp3_1 and I have applied a track name to it. We’ll call it Voices.mp3
I can do
[audio: Voices.mp3]
in the associated post editor and it displays the player fine (meaning everything else like the audio directory is setup correctly)I wish to access this custom field in a category template I created to display CDs of a certain musician and display the player – to automate things via a CMS. I read a lot about shortcode lately and this is what people are saying to do within the category template:
echo do_shortcode('[audio: Voices.mp3]');
However, it just prints the text –
[audio: Voices.mp3]
I wish to eventually do this:
//get the custom field value from this post and key cd_mp3_1 $temp = get_post_meta ($post->ID, 'cd_mp3_1', true); //pass $temp as argument of function do_shortcode echo do_shortcode($temp);
this is my first post ever so I hope I did the backticks correctly where needed when showing code examples
- The topic ‘[Plugin: Audio Player] accessing audioplayer with do_shortcode() only printing text’ is closed to new replies.