I frequently use the WordPress audio shortcode to embed my podcast episodes in my posts:
http://podcastsourcefile
Unfortunately, the default audio player looks terrible. I would like to have it restyled with CSS. I have a mockup I can send to show you what it should look like, but here’s the basic gist:
- background color: #B27D47
- replace play button image (I can provide the .png file)
- make the player 75 pixels tall, 100% width
- round the corners of the player
Here’s what I would like the player to look like:
(I have the .png file of the play button.)
Consider this:
This way, you can now copy the whole mediaelement folder out of wp-include, enqueue your copy instead of the original and then fiddle with the .css there. The lines marked with //optional show how you can use different styles depending on the page your visitor is in. Found it here
There are two filter hooks to deal with this. One at the beginning, with very few info, with it we shortcut the whole shortcode and return our own custom HTML code:
The parameters that arrive are:
And the other one that runs at the end of the shortcode function:
The parameters that arrive are:
I just did it by styling my custom.css in the theme editor.
The values of the audio shortcode are the following. In my case, I changed it so it won’t be affected by any WordPress update (even if it’s dirtier than the PHP solution on the other comment). You could use the developper tools and style the player your own way (my problem was that i didn’t need a 100% width player).
:
... {...}
I added my stylesheet additionally to the existing one, like I explained in this post:
For example if you want to color the players background, you could add now the following to audio-player-styles.css: