This week Nick Halsey published his new Featured Audio plugin to the WordPress Plugin Directory. Halsey, a WordPress core contributor and a musician, created the plugin to provide a solution that would associate audio files with posts in the same way that WordPress supports featured images out of the box.
The plugin works with any WordPress theme to display featured audio at the top of posts and pages (within the_content) where you might ordinarily expect a featured image. It adds a new featured audio metabox beneath the featured image metabox where users can upload a file or select from the media library. In its most basic form, the plugin takes on the audio player style dictated by the theme. For example, this is the default player display in Twenty Fifteen:
The player can also be further customized by themes to display album art and/or the title of the audio attachment.
In a post introducing Featured Audio, Halsey emphasized the importance of making the plugin extensible. He built public API functions into the plugin to enable developers to create their own implementations.
Halsey is currently building a commercial theme for musicians and music groups that integrates with his Featured Audio plugin. He said that he hopes the plugin will provide “a core-like solution that themes and other plugins can extend” and improve data portability for users’ audio files.
“I’d love to see more themes designed specifically to make audio a central component of sites’ content,” Halsey said. “If they all leverage this standardized featured audio plugin, users publishing audio content can get a wide variety of options for displaying their content and the content adapts seamlessly from theme to theme, just like publishers of visual content get with featured images.”
As an example of what theme developers can do with the API, Halsey built a playlist widget that is populated by featured audio files from posts on the page being viewed, such as the block index, archive, or taxonomy page. It gives visitors the opportunity to browse more of the site’s audio content without having to click through to each individual post.
Halsey said that one of his goals with creating Featured Audio was to encourage publishers to host their own audio files with WordPress as opposed third-party services like Soundcloud.
“WordPress is about democratizing publishing, and part of that mission is to give users complete control over their content,” Halsey said. “With better resources for publishing audio directly in WordPress, fewer users will feel a need to turn to third-party services. Long term, it would be awesome to see third-party social and aggregation sources for audio content pulling data out of WordPress sites rather than the other way around, as it is currently.”
If your site publishes audio content and you want to be able to feature audio files like featured images, check out the Featured Audio plugin on WordPress.org.