Hi,
please search for the following code in “header.php”:
<?php wp_nav_menu( array( 'menu_id'=>'nav', 'theme_location'=>'main-navigation' ) ); ?>
Just under it, place this code to display an audio player:
<div style="float: left; margin: 10px 0 0; width: 100%;"><?php echo do_shortcode( '[audio src="http://url-of-your-audio-file.mp3"]' ); ?></div>
If you would like to remove the default margin below the audio player, please use this custom CSS:
.menu-box .wp-audio-shortcode {margin-bottom: 0;}
Best regards,
Tomas Toman
Thank you so much for helping me!
I inserted the code (as shown below), but nothing seems to be appearing below the menu still. Any idea why? I also tried inserting your code by only changing the File URL to a song in my media library. Nothing showed then either. I tried disabling a few plugins as well, which had no effect.
<?php } ?>
<?php wp_nav_menu( array( ‘menu_id’=>’nav’, ‘theme_location’=>’main-navigation’ ) ); ?>
<div style=”float: left; margin: 10px 0 0; width: 100%;”><?php echo do_shortcode( ‘[playlist tracks="Love-WIll-Bring-Us-Back-Home1.mp3, Ascending-Into-Color.mp3, Gypsies.mp3", Space-For-Space-MSTR.mp3, Dangified-MSTR-01.mp3]‘ ); ?></div>
<div class=”scroll-top”></div>
</div>
Thank you again! I really appreciate it!
Lindsi
Dear Lindsi,
according to the Codex page, it seems that the “tracks” is not a valid parameter for the “playlist” shortcode. Instead of it, you should specify IDs of audio files out of the media library.
Or, if you decide to use the “audio” shortcode instead of “playlist”, please try to specify the full URL address of an audio file instead of relative URL, for example:
[audio src="http://wpthemetestdata.files.wordpress.com/2008/06/originaldixielandjazzbandwithalbernard-stlouisblues.mp3"]
Best regards,
Tomas Toman
You can find the appropriate audio file’s ID in the media library, when you display the detail of an audio file (the ID is located in your browser’s address bar like this).