How to dynamically define audio playlist within the shortcode


WonderPlugin Audio Player 4.8 and above


Can I use the same audio player on multiple pages but with a different playlist on each page?


You can define playlist within the plugin shortcode.

Please add a parameter inline=1 to the shortcode and follow the code example to define your own playlist:

[[wonderplugin_audio id=1 inline=1]

<ul class="amazingaudioplayer-audios" style="display:none;">

<li data-artist="pinkzebra" data-title="In the Moment of Inspiration" data-album="" data-info="" data-image="" data-duration="154">

<div class="amazingaudioplayer-source" data-src="" data-type="audio/mpeg" ></div>


<li data-artist="pinkzebra" data-title="Peaceful Dawn" data-album="" data-info="" data-image="" data-duration="129">

<div class="amazingaudioplayer-source" data-src="" data-type="audio/mpeg" ></div>



Since the shortcode filter is running after the wpautop filter, on some WordPress sites, wpautop may add p tags to the beginning and ending of the playlist HTML code which will create some extra space in the player.

In this case, you can add the following CSS code to the plugin, step 3 Options tab, Custom CSS box:

.wonderpluginaudio p {
    display: none !important;