Home / Downloads / Templates / Inserting an Audio Player in Your Theme’s Template File

Inserting an Audio Player in Your Theme’s Template File

Step 1. Introduce the Audio Player Plugin

Get the sound player plugin from here.

 

Step 2. Utilize the PHP Code as a part of Your Template File

Alter your layout document and utilize the accompanying PHP code (where you need to embed the sound player).

 

<?php
$args = array('fileurl' => 'www.example.com/my-music/mysong.mp3');
echo sc_embed_player_handler($args);
?>

You will need to utilize the right URL of the sound record that you need to install.

You can additionally pass extra player parameters like the accompanying illustration

<?php
$args = array('fileurl' => 'www.example.com/my-music/mysong.mp3', 'autoplay' => 'true', 'loops' => 'true');
echo sc_embed_player_handler($args);
?>

The above code should embed a playable audio file that looks like the following:

wordpress-audio-player-plugin-screenshot

PHP Code for Template 1

Use the following code if you want to use audio player template 1:

<?php
$args = array('fileurl' => 'www.example.com/my-music/mysong.mp3');
echo sc_embed_player_templater1_handler($args);
?>

Alternative Code

You could also use the following PHP code instead of the one shown above:

<?php echo do_shortcode('[sc_embed_player fileurl="www.example.com/my-music/mysong.mp3"]'); ?>

 

About Shah Zeb Raza

Name : Shah Zeb Raza .
He is Admin and Owner of WebsTeach. he is a developer and designer of website’s , Hosting , Software , Applications, Professional Editor Of pictures, SEO Expert and much more.
Visit Blog : www.shahzebraza.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

x

Check Also

URDU Paper Premium WordPress Theme for Newspaper Free download

Free Download Latest Version of  UrduPaper WordPress Theme which is totally free ...