- This topic has 5 replies, 2 voices, and was last updated 11 years, 10 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Compact Audio Player shortcode in custom field
Will the Compact WordPress Audio Player plugin short code work in single and multiple custom fields on a single post? I tried using it and the button appears in the first instance but does not play. In the other instances the buttons do not display. I am using this in eStore.
This is a music site where a single post can have multiple versions of the same song.
Thank you for any help!
Hi, The compact audio player has a shortcode that you can use on your post or pages or inside the the description field of a product.
I am not sure what you mean by “custom fields”? The audio player plugin doesn’t do anything with custom fields.
I use custom fields for the MP3 path and multiple custom fields, per post, to render my display of a post. As an example the plug in “Audio Player” will recognize the MP3 path and work correctly in the body of a post but in not if the MP3 path is in a custom field.
My question is: Will the “Compact WordPress Audio Player” plugin short code (which includes the MP3 path) work in single and multiple custom fields on a post?
Thank you.
I see what you mean. No the compact audio player plugin won’t work with custom fields at all.
Okay, thanks for the reply.
Art
Okay I found an answer to this problem that I have been chasing for a while. I inserted the following code into my single.php file.
<?php
if ( get_post_meta($post->ID, 'your_custom_field', true) )
echo do_shortcode(get_post_meta($post->ID, 'your_custom_field', $single = true));
?>
Just replace “your_custom_field” with your own custom field name. You will now be able to use shortcodes in your custom field.