In an early guide, we discussed how to add music to WordPress posts, pages, sidebar, footer, etc. After that we have received some feedback from our website visitors, some of them like to add music to WordPress homepage only, not the entire WordPress site or other WordPress posts or pages.
How to Add Music to WordPress Homepage?
There are basically two steps to embed a music player in WordPress home page. Firstly you need to set a specific page as the front page of your WordPress site, other than displaying your latest posts in the front page. Then you will need to embed the music player in this new WordPress home page. Following are the details.
Add music to WordPress page
Log on to your WordPress dashboard, go to Pages >> Add New, to create a new page as your WordPress home page, or go to All Pages to open and edit an existing page that you like to set as front page of your WP site. Click Add Media button above WordPress editor window. You can then upload music files from your local computer to WordPress hosting server or site. You can also choose existing music songs from your media library online. There will be an ATTACHMENT DISPLAY SETTINGS section in the WordPress music embedding page as below.
Make sure to choose Embed Media Player from the option list. Then click Insert into page to add music to WordPress front page to be. If you like to play music on the WordPRess home page automatically, you need to modify the music or audio player, add the autoplay=”on” to your music player embedding code. See below:
Note: replace the above URL with your own. It should be an absolute URL, other than a relative URL to your uploaded music file. It could be ‘mp3’, ‘m4a’, ‘ogg’, ‘wav’ or ‘wma’.
Save the update of your WordPRess or publish if it is a new page. Now you should open the new WordPress page and hear the music plays automatically on your web browsers.
Set the page as WordPress homepage
You have added music to your WordPRess page, now you need to set it as your Front page if not yet. Go to WP Dashboard >> Settings >> Reading.
Click the Reading menu, you will have the option to set or change your WordPRess home page.
From above screen, click A static page, then select a page from in the Front page field as your new WordPress home page. Then click the Save Changes button in the bottom of this page. Open your WordPress main page, your embedded music will now plays automatically.