Writing New Styles For A Standard WordPress Media Player
Developers are always striving to create a unique design for their themes so that their solutions interest the maximum possible number of users in the WordPress ecosystem. And since WordPress comes with its widgets, shortcodes and other components, it is important that the theme takes all this into account and is appropriate for its purpose. Most native WordPress components (widgets or shortcodes, for example) do not have their own predefined styles, but some still have styling (for example, an audio player). In this article, we'll take a look at how to customize styles for a standard WordPress media player to fit the theme. WordPress Media Player WordPress Media Player is a wrapper based on MediaElement.js, a powerful, customizable player equipped with HTML5 capabilities. By default in WordPress it looks like this: In this tutorial, we will generate a set of predefined selectors for the player (along with an audio playlist in WordPress) so that it fits better with our theme. We start with the following: First, we will make the player brighter, which will suit most topics. Scripts and Styles First, let's create a my-theme-player.css file to accommodate arbitrary styles of the media player, and connect it accordingly (in theme functions.php): 01 15 16 (function() )(); 24 25 button 11 background-image: url(images/mejs-controls-dark.svg); 12 13 14 .mytheme-mejs-container .mejs-time 15 color: #888888; 16 17 18 /* Progress and audio bars */ 19 20 /* Progress and audio bar background */ 21 .mytheme-mejs-container .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, Grocery Store Elementor Template Kit Download 22 .mytheme-mejs-container .mejs-controls .mejs-time-rail .mejs-time-total 23 background-color: #fff; 24 25 26 /* Track progress bar background (amount of track fully loaded) 27 We prefer to style these with the main accent color of our theme */ 28 .mytheme-mejs-container .mejs-controls .mejs-time-rail .mejs-time-loaded 29 background-color: rgba(219, 78, 136, 0.075); 30 31 32 /* Current track progress and active audio volume level bar */ 33 .mytheme-mejs-container .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current, 34 .mytheme-mejs-container .mejs-controls .mejs-time-rail .mejs-time-current 35 background: #db4e88; 36 37 38 /* Reduce height of the progress and audio bars */ 39 .mytheme-mejs-container .mejs-time-buffering, 40 .mytheme-mejs-container .mejs-time-current, 41 .mytheme-mejs-container .mejs-time-float, 42 .mytheme-mejs-container .mejs-time-float-corner, 43 .mytheme-mejs-container .mejs-time-float-current, 44 .mytheme-mejs-container .mejs-time-hovered, 45 .mytheme-mejs-container .mejs-time-loaded, 46 .mytheme-mejs-container .mejs-time-marker, 47 .mytheme-mejs-container .mejs-time-total, Helpo v.1.0.1 Fundraising & Charity HTML Template Purchase Code 48 .mytheme-mejs-container .mejs-horizontal-volume-total, 49 .mytheme-mejs-container .mejs-time-handle-content 50 height: 3px; 51 52 53 .mytheme-mejs-container .mejs-time-handle-content 54 top: -6px; 55 56 57 .mytheme-mejs-container .mejs-time-total 58 margin-top: 8px; 59 60 61 .mytheme-mejs-container .mejs-horizontal-volume-total 62 top: KICKCUBE v.2.8 Nulled 19px; 63 The styles above will allow you to get such a player: Handsomely.
We changed the background color, text color, as well as the progress bar line. For the buttons, you will need to create a new set of SVG icons with dark icons, since by default they are completely white. You can Breeze Lite 1.4 Social Network Platform Nulled Download the kit from the link . Add it to the / images directory. As you noticed, there are a lot of nesting in the code. Unfortunately, we cannot do without them, since MediaElement.