Can you please tell me what is the error in this wordpress template tag: <?php echo do_shortcode('[audio src="<?php $values = get_post_custom_values("video"); echo $values[0]; ?>" loop="true" preload="true"]'); ?> PHP: I am using a shortcode as template tag and trying to get the audio source from a custom field on new post page, but not working.
Try this it might work. I could not test it. <?php echo do_shortcode('[audio src="'.get_post_meta($post->ID, 'video', true).'" loop="true" preload="true"]'); ?> Code (markup):
Well do you get any kind of error or output in the code? Hard to help with out being able to see what the result is. Is the custom field value the correct name? It looks like you are trying to use a video link in an audio shortcode?
OH! So Sorry, You are right I was getting video field in audio code thats why its not working. Now after correcting it, it started working perfectly. Thanks.
Can you please help me one more time LGRComp, I am using this <?php $values = get_post_custom_values("lyrics"); echo $values[0]; ?> PHP: to get the lyrics I am adding in the custom field, but when I am adding content like: means line by line BUT it outputs it like: That means in single line