How to add buy now buttons to WordPress audio player

Product:

WordPress Audio Player

Question:

Can you put a "buy now" button on each song that we can set a URL where people can purchase that song or playlist?

Answer:

Please note, this answer only adds required buy now links to the audio player. The plugin does not include a shopping cart function and it's your own responsibility to integrate the buy now links to your shopping cart.

In the plugin, step 3, Options tab, Advanced Options, add the following text to the Advanced Options box:

data-tracklistitemformat="%ID%. %TITLE% <span style='float:right;'><a href='https://www.wonderplugin.com/demo-checkout/?id=%ID%'>Buy Now</a></span>"

In the above text, the %ID%, %TITLE% are pre-defined macro variables supported by the plugin. They will be dynamically replaced when the player is rendered.

The text <a href='https://www.wonderplugin.com/demo-checkout/?id=%ID%'>Buy Now</a> defines the Buy Now link. The %ID% in the href value will be dynamically replaced by the current audio id. When the player is rendered, the Buy Now link for each audio will be:

https://www.wonderplugin.com/demo-checkout/?id=1
https://www.wonderplugin.com/demo-checkout/?id=2
https://www.wonderplugin.com/demo-checkout/?id=3

In your checkout page (in this tutorial, it's https://www.wonderplugin.com/demo-checkout/), you need to check the value of parameter id, and add the corresponding audio to your shopping cart. Please make sure to change the URL to your own checkout page.

The CSS span style will move the Buy Now link to the right of the play list.

Do not auto play next track in WordPress audio player plugin

Product:

WonderPlugin Audio Player Plugin

Question:

I have a quick question, can the play lists be set to not auto play the next track?

I need the play list to only play a track when i click on it.

Answer:

In the plugin, step 3, Options tab -> Skin Options, change the Loop Mode to No loop.

Then in Options tab -> Advanced Options, enter the following text to the Advanced Options box:

data-noncontinous="true"

Show artist name in playlist

Product:

WordPress Audio Player

Question:

Is there a way to include the artist name, as well as the track title, in the playlist?

Answer:

In step 3, Options tab, click Advanced Options tab, then enter the following text to the Advanced Options box:

data-tracklistitemformat="%ID%. %ARTIST% - %TITLE% <span style='position:absolute;top:0;right:0;'>%DURATION%</span>"

How to play a Shoutcast streaming in WordPress audio player

Product:

Wonder Audio Player

Question:

I wonder how could I play a Shoutcast audio streaming with Wonder Audio Player? I tried to enter the address of the .pls file to the plugin, but it's not playing.

Answer:

For full instructions of how to create a Shoutcast live streaming player in WordPress, please view the tutorial: How to create a WordPress Shoutcast player.

The .pls file is actually a text file that contains a link or links to the audio streaming. You need to open the .pls file with a text editor, find the streaming URL and directly enter the streaming URL to the plugin.

If the streaming URL has a format like:

http://IP:port

You need to add a suffix ;&type=mp3 and enter the following URL to the plugin:

http://IP:port/;&type=mp3

Then in the plugin, step 1, Add Audio dialog, you can enter the streaming URL to the Mp3 URL box and check the option "This is a live streaming".

You can view the tutorials on the page:

https://www.wonderplugin.com/wordpress-audio-player/examples/wordpress-live-streaming-audio-player-id16/

WonderPlugin Audio Player JavaScript API

This post will show you how to use JavaScript to control the WonderPlugin Audio Player.

The following JavaScript will play the audio:

jQuery("#wonderpluginaudio-1").data("object").playAudio();

In the above code, 1 is the id of the audio player. wonderpluginaudio-1 is the id of the created player DIV.

If the id of your player is 2, you need to change the id value accordingly:

jQuery("#wonderpluginaudio-2").data("object").playAudio();

To pause the player:

jQuery("#wonderpluginaudio-1").data("object").pauseAudio();

The function audioRun(index, autoplay) will jump to the specified audio. The index starts from 0. For example, the following function will jump to the second audio and play it:

jQuery("#wonderpluginaudio-1").data("object").audioRun(1, true);

To goto the previous audio:

jQuery("#wonderpluginaudio-1").data("object").audioRun(-2, true);

To goto the next audio:

jQuery("#wonderpluginaudio-1").data("object").audioRun(-1, true);

The following four text links will play, pause, jump to the second audio and jump to the fifth audio in the following player:

<a onclick='jQuery("#wonderpluginaudio-1").data("object").playAudio();'>Click to Play</a>

<a onclick='jQuery("#wonderpluginaudio-1").data("object").pauseAudio();'>Click to Pause</a>

<a onclick='jQuery("#wonderpluginaudio-1").data("object").audioRun(1, true);'>Jump to Second Audio and Play</a>

<a onclick='jQuery("#wonderpluginaudio-1").data("object").audioRun(4, true);'>Jump to Fifth Audio and Play</a>

The demo is as following:

Click to Play
Click to Pause
Jump to Second Audio and Play
Jump to Fifth Audio and Play

Remove track numbers in audio player playlist

Question:

Is there a way to get rid of the track numbers in the audio player playlist?

Answer:

In step 3, Options tab, click Advanced Options button, enter the following code to the Data Options field:

data-tracklistitemformat="%TITLE% <span style='position:absolute;top:0;right:0;'>%DURATION%</span>"

The demo is as following:

Multiple jQuery loaded in WordPress

Question:

I have a website in progress, I used Wonderplugin for WordPress and as I came across on the development, I cannot get it working.

I already uploaded images and configured everything on WordPress.

I also copied the shortcode to the php page that I am working on. But the carousel does not show up.

Answer:

Normally this problem is that there are multiple jQuery files added to your WordPress.

You can view the HTML source code of your webpage, and check how many jQuery are added in your website. In Google Chrome, you can view the HTML source code with menu View -> Developer -> View Source, then search text "jquery" in the source code.

There should be only one jQuery in the webpage, which is added by the WordPress system.

Some plugins add their own jQuery to the website, and this is not correct. A plugin should always use the system installed jQuery, and the js files added from a plugin will be added after the system jQuery.

A jQuery will destroy all other jQuery functions that are added before it. So if a plugin adds its own jQuery, it may destroy other jQuery functions.

To fix the issue:

In the plugin, Setting menu, you can try to check the option "Add plugin js scripts to the footer". This option will place the plugin js file to the footer and will fix the problem in most cases.

If the above option is not working, you can try to disable all other plugins and see whether the WonderPlugin works. If it works, you can then enable the plugins one by one, and find the plugin that has caused the problem.

If WonderPlugin is still not working after you have disabled all other plugins, then the extra jQuery may have been added manually to the theme or the page, you need to find the code and remove it.

Add mp3 download link to audio player

Product:

Wonder Audio Player

Question:

How can I add download links to the player so my visitor can download the mp3 file?

Answer:

Updated on May 2020: Wonder Audio Player Version 9.6 added 6 skins to directly create audio players with download buttons and social media share buttons. Please view the following tutorial for how to use the new skins: WordPress audio player with download buttons and social media share buttons.

You can add download links to the player track list.

In the plugin, step 2 Skins dialog, please choose a skin that has a track list, then in step 3, Options tab, click the Advanced Options button, enter the following text to the Data Options field:

data-tracklistitemformat="%ID%. %TITLE% <span style='float:right;'><a href='%AUDIOURL%' class='wpaudiodownloadlink' download='%TITLE%.mp3' target='_blank' onclick='event.stopPropagation();'>Download</a></span>"

In the above code, %ID%, %TITLE% and %AUDIOURL% are predefined macro variables. They will be replaced by each audio id, title and audio URL dynamically.

An online demo is as follows:

How to upgrade to a new version without losing existing work

This is a tutorial for how to upgrade the plugin to a new version manually. You can use this tutorial to upgrade a free or commercial version to its latest version.

Before following the tutorial, we highly recommend that you make a backup of your WordPress website.

There are two methods to upgrade the plugin to its latest version manually:

The First Method

There are 4 steps in this method:

Step 1 - Make sure the keep data option is enabled

In your WordPress backend, goto the left menu Plugin Name (e.g., Wonder Carousel, Wonder Slider, etc) -> Settings, make sure there is an option Keep data when deleting the plugin and the option is checked. The option is checked by default. If your current version is very old, it may not have this option. In this case, do not use this method, use the following second method instead.

Step 2 - Deactivate and delete the old version

In the WordPress backend, goto the left menu Plugins -> Installed Plugins, deactivate the plugin and delete it. When deleting the plugin, ignore the warning "Are you sure you wish to delete these files and data" and click the button "Yes, Delete these files and data". This is a standard warning from WordPress.

Step 3 - Install and activate the new version

In the WordPress backend, goto the left menu Plugins -> Add New, click Upload Plugin, select the downloaded new version plugin zip file, install and activate it.

Step 4 - Clear WordPress Caches

  • If you have installed a WordPress js/css minify plugin or WordPress cache plugin for example, Autoptimize, W3 Total Cache, WP Rocket, WP Fastest Cache, WP Super Cache, empty all caches from the plugin.
  • Some web hosts, for example, GoDaddy, WPEngine, SiteGround, DreamHost, will also cache web files. You need to clear caches of the web hosting before testing. Please contact your web hosting provider and ask about how to clear caches.
  • Clear caches of your web browser before testing

The Second Method

If you are using a very old version, you may need to use this method to upgrade the plugin. There are 3 steps in this method:

Step 1: Install the new version plugin via FTP

First please extract the new version plugin ZIP file to a folder on your computer, then upload the extracted Plugin folder to the wp-content/plugins folder in your WordPress FTP server.

When a ZIP file is extracted, some unzip software may add a parent folder outside of the Plugin folder. Please make sure you have uploaded the Plugin folder, not its parent folder.

If your WordPress already has an old version installed, make sure to overwrite the existing folder in the server. Or you can delete the old version files first then upload the new version files.

Step 2: Make sure the plugin is activated

In your WordPress backend, left menu, Plugins -> Installed Plugins, find the plugin from the list, make sure the plugin is activated. If it's not, click the Activate link.

Step 3 - Clear WordPress Caches

  • If you have installed a WordPress js/css minify plugin or WordPress cache plugin for example, Autoptimize, W3 Total Cache, WP Rocket, WP Fastest Cache, WP Super Cache, empty all caches from the plugin.
  • Some web hosts, for example, GoDaddy, WPEngine, SiteGround, DreamHost, will also cache web files. You need to clear caches of the web hosting before testing. Please contact your web hosting provider and ask about how to clear caches.
  • Clear caches of your web browser before testing