Title: Add a PHP
Last modified: February 17, 2025

---

# Add a PHP

 *  [jwhitesides](https://wordpress.org/support/users/jwhitesides/)
 * (@jwhitesides)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/add-a-php/)
 * I’m in need of getting an Advanced Custom Field to show a music player from a
   streaming service. I have a specific style that I’ve already done to the embed
   code for 5 different music streaming sites. Which is in the database.
 * ACF requires a need to use a code like: `<?php echo the_field('apple_music_embed');?
   >`
 * However attempting to put that in a customHTML bit for a pattern/template is 
   not possible as it giving a blank spot saying it’s some sort of violation. Which
   is odd since if I put the actual iframe code in the customHTML box manually, 
   it works perfectly fine. Is there a way to use PHP in a block to do the same 
   thing from the database?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadd-a-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Carolina Nymark](https://wordpress.org/support/users/poena/)
 * (@poena)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/add-a-php/#post-18309634)
 * Hi,
   For any plugin related questions, please always use the support channels 
   for the plugin.
 *  Thread Starter [jwhitesides](https://wordpress.org/support/users/jwhitesides/)
 * (@jwhitesides)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/add-a-php/#post-18309753)
 * let me rephrase the question: How would I be able to use a php command in a twenty
   twenty-five block?
 *  [Carolina Nymark](https://wordpress.org/support/users/poena/)
 * (@poena)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/add-a-php/#post-18309875)
 * You need to use or build a custom block, or you can try to use a block binding.
   
   These are advanced developer topics.[https://make.wordpress.org/core/2024/03/06/new-feature-the-block-bindings-api/](https://make.wordpress.org/core/2024/03/06/new-feature-the-block-bindings-api/)
   This is not specific to Twenty Twenty-Five, all block themes use HTML for the
   templates, not PHP.Patterns use PHP, but simplified, they show what the PHP produced
   when the post content is saved.
 *  [WP SITES](https://wordpress.org/support/users/wordpresssites/)
 * (@wordpresssites)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/add-a-php/#post-18343514)
 * You could create a shortcode :
 *     ```wp-block-code
       function apple_music_shortcode() {    ob_start();    the_field('apple_music_embed');    return ob_get_clean();}add_shortcode('apple_music', 'apple_music_shortcode');
       ```
   

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

The topic ‘Add a PHP’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/twentytwentyfive/1.5/screenshot.
   png)
 * Twenty Twenty-Five
 * [Support Threads](https://wordpress.org/support/theme/twentytwentyfive/)
 * [Active Topics](https://wordpress.org/support/theme/twentytwentyfive/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/twentytwentyfive/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/twentytwentyfive/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [WP SITES](https://wordpress.org/support/users/wordpresssites/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/add-a-php/#post-18343514)
 * Status: not resolved