WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created custom field and placed this inside the loop:

<?php echo get_post_meta($post->ID, 'ses', true); ?>

But now the link is all text. I would like it to be like my theme does when I use this shortcode:

[media url="http://www.example.com/songname.mp3"] 
share|improve this question

You have to echo the full Audio Tag and insert the custom field MP3 address in it.

    if ( get_post_meta($post->ID, 'ses', true) ) {
        echo '<audio controls="controls">
                <source src="' . get_post_meta($post->ID, 'ses', true) . '" />
share|improve this answer
perfect. thank you – 1907 Jun 13 '12 at 18:51
one little problem. now the player is in every post. – 1907 Jun 13 '12 at 19:13
The Codex is your friend, read the Codex. Answer updated :) – brasofilo Jun 13 '12 at 19:19
brasofilo, could you help me out with one last thing, now i tried to post youtube video. how can i make it visible in my site? i found youtube id code. but i want to make it with full yotube video url. thank you... – 1907 Jun 13 '12 at 23:06
1907, WordPress has a feature called oEmbed that can help you with that, search for it here or at WordPress Forums. Hopefully, you'll be around enough time to find that this site is a great learning resource. For a better experience I suggest you read the full FAQ (you'll even earn an extra badge for that :). – brasofilo Jun 13 '12 at 23:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.