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"] 

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) . '" />
| improve this answer | |
  • 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
  • you are right but all sites are english. i am having hard time to understanding it. my english not that good. thats why i am asking so many questions. actualy i love reading but in turkish :) – 1907 Jun 13 '12 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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