Support

Account

Home Forums General Issues Play audio trough a ACF field using HTML and shortcode

Solving

Play audio trough a ACF field using HTML and shortcode

  • I am trying to play a audio file when a user clicks on icon. The audio should be determined through a ACF. I am currently trying the following:

    <div class=”player”>

    <audio>
    <source src=”<?php the_field(‘audio_url’); ?>”
    </audio>
    </div>

    But, it does not work. How can I make this work? I have also tried to use direct shortcode, like this:

    <audio>
    <source src=”=”[acf field='audio_url']“>”
    </audio>
    </div>
    The audio is not playing. I am struggling to manage to get the audio url from a custom field on the page. See this URL for the live icon: https://wp00377.prod.aluweb.no/?page_id=6

  • exactly where and how are you trying to add this code?

  • Sorry late answer, I have added a beaver builder HTML module with the code I mention in last comment. Together with some Javascript lines, they are displaying this icon: https://share.getcloudapp.com/yAuQYXkr

    The problem is pointing to a custom field inside the HTML.

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

You must be logged in to reply to this topic.