• I’m coding a WordPress site. It’s for a musician who needs a page where the user will be able to navigate between albums, and for each album see the album cover, track list, lyrics for all songs on the side, and be able to play each song in a music player.

    My question is, what would be the best way to code this structure in WordPress? Should I create an albums custom post type? How will I associate each song with an album? How will I use the meta data for each song, for instance, to play it in a music player?

    Your help is much appreciated, thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think I would create a category called albums and then have posts for each album. To achieve the extra information such as lyrics and music player you could use custom fields on the post.

    The image of the album cover could be done with WordPress “Featured Image” (Post thumbnails) feature, track list could be placed in the content of the post as well as the lyrics for the song.

    The music player file could be added as a custom field and then loaded in your theme with get_post_meta() function.

    I am sure there are lots of ways of going about this but this is my initial ideas.

    Thread Starter idosius

    (@idosius)

    Thanks for the help. In the end I decided to go for a slightly different solution to make everything more organized and easier for the user:

    1. Created a new custom post type called ‘album’.
    2. Added meta boxes to the album post type for the relevant fields – e.g. cover art URL, buy link, etc.
    3. Still in the album post type, I added meta boxes for each track as well – name, MP3 URL, video URL, and lyrics. I created 20 tracks in advance which is sufficient for most musicians, tracks with empty data are simply ignored. If I had more time, I might have implemented some nifty ‘add/remove track’ buttons with jQuery.
    4. Made a special template for the albums page that pulls out the meta data, indeed using get_post_meta, and displays it accordingly.

    I found the following tutorials quite useful in accomplishing this task:
    https://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
    https://farinspace.com/how-to-create-custom-wordpress-meta-box/

    HTH!

    Hi,

    i’m coding a wordpress site for my own purpose with a very similar concept. I wondered if you heard about a way to upload the audio files directly from the custom post, using metabox or anything else…

    Thread Starter idosius

    (@idosius)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Managing albums and songs in WordPress’ is closed to new replies.