Dynamic Link in template files
-
I want to set this player up in my single post template file to get the mp3 fileurl from a custom field.
I am using the exact code from this post, marked as ‘resolved’ https://ww.wp.xz.cn/support/topic/dynamic-url-in-shortcode?replies=2
This is the code i am using
<?php $post_meta_value = get_post_meta($post->ID, 'sound_url',TRUE); echo do_shortcode('[sc_embed_player fileurl='.$post_meta_value.']'); ?>I’ve even given my custom field the name ‘sound_url’ to try and preserve the code above exactly as it is. However it does not work!! If i add the fileurl link directly it works, but adding any sort of variable does not.
For a while, the player would show up, but when i press the play button it would play no sound. However ever since i changed the post custom field to ‘sound_url’ i get the following error
Compact Audio Player Error! You must enter the mp3 file URL via the "fileurl" parameter in this shortcode. Please check the documentation and correct the mistake.I have been stuck on this issue for a couple days, i’ve done as much research as i can and cannot find a solution. If anyone can help (not just plugin developer) it will be greatly appreciated.
The topic ‘Dynamic Link in template files’ is closed to new replies.