Title: Function for theme programming?
Last modified: August 20, 2016

---

# Function for theme programming?

 *  Resolved [mwarner1](https://wordpress.org/support/users/mwarner1/)
 * (@mwarner1)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/function-for-theme-programming/)
 * Great plugin. It looks like the only way to embed an audio player is via a post
   or page. Is there support for a function I could use in my theme files to embed
   the player? I’d like to be able to pull a URL to an mp3 file out of a custom 
   field and enter that as an argument to a function. Thanks!
 * [http://wordpress.org/extend/plugins/pb-oembed-html5-audio-with-cache-support/](http://wordpress.org/extend/plugins/pb-oembed-html5-audio-with-cache-support/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [PascalBajorat](https://wordpress.org/support/users/pascalbajorat/)
 * (@pascalbajorat)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/function-for-theme-programming/#post-3467097)
 * Hi,
 * yes that’s no problem, here is my example code:
 *     ```
       <?php
       // http://codex.wordpress.org/Function_Reference/get_post_meta
       $custom_field_mp3 = get_post_meta(get_the_ID(), 'mp3', true);
   
       if( !empty( $custom_field_mp3 ) ):
   
       // http://codex.wordpress.org/Function_Reference/do_shortcode
       echo do_shortcode('[audio mp3="'.$custom_field_mp3.'"]');
   
       endif;
       ?>
       ```
   
 * Please note: There is a new and important update out now v.2.2!
 * If you like the Plugin please rate it 😉
 *  Thread Starter [mwarner1](https://wordpress.org/support/users/mwarner1/)
 * (@mwarner1)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/function-for-theme-programming/#post-3467124)
 * Awesome. Thank you.
 *  [thob](https://wordpress.org/support/users/thob/)
 * (@thob)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/function-for-theme-programming/#post-3467174)
 * sorry wrong place

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Function for theme programming?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pb-oembed-html5-audio-with-cache-
   support_248ea6.svg)
 * [PB oEmbed HTML5 Audio - with Cache Support](https://wordpress.org/plugins/pb-oembed-html5-audio-with-cache-support/)
 * [Support Threads](https://wordpress.org/support/plugin/pb-oembed-html5-audio-with-cache-support/)
 * [Active Topics](https://wordpress.org/support/plugin/pb-oembed-html5-audio-with-cache-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pb-oembed-html5-audio-with-cache-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pb-oembed-html5-audio-with-cache-support/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [thob](https://wordpress.org/support/users/thob/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/function-for-theme-programming/#post-3467174)
 * Status: resolved