Create an archive page(loop) for edd products (music files) with an audio player?

You can follow the exact same procedure as explained here by making the player be a custom taxonomy each song a custom post type.

A custom taxonomy will serve as a group of songs. Just like you give a category to an article, here you give a song, a playlist. You can set this up so you have a many to many relationship. Once you have this backend structure, you can then set up your post meta and term meta so that you can either give soundcloud ids to songs or upload it on your media handler, whatever floats your boat. Once this is correctly done, you can look into the actual player itself, you have millions music players as js/jquery libraries.

With this set up you have:

  • single-songs (your custom post type single page) this represents your song itself, contains the information about each song: length, title, categories, artists and in which playlist this is contained

  • taxonomy-player: this is a custom taxonomy that contains terms. These terms are playlists. Each term is then used to build the playlist. It’s a simple way to make groups of things, just like a playlist is a group of songs.

To then display these playlists you can create a shortcode that will get_posts($args) for a specified term. You can get meta data of each term by using get_term_meta and song specific information with get_post_meta

Conceptually, this is how it works.

tech