I would probably go with a custom post type ( draught
– the golden honey from the gods ) as you already have.
I would then create two taxonomies, keg
( which can be a hierarchical taxonomy ) and line
( which can be a non-hierarchical taxonomy )with their respective terms.
Example :
-
keg
- coors
- bud
- labatte
-
line
- one
- two
- three
The reason for keg
being hierarchical is that you can later have child terms under your parent terms which makes it easier to extend
Each time a new post is published, you can assign one term from each taxonomy to it. The advantage here is, you are looking for a system where you can keep records of previous pairings etc. You will not have this if you simply keep on updating the same post. Yes, you can work with revisions, but that is really not the way to go here
So what you should do is, create a new post everytime something changes in your line up and assign the appropriate terms to that specific post.
The only issue is going to be how you are going to display them on your home/front page ( I would opt for a static front page here). In my opinion, you will need to loop over each term in the line
taxonomy and get the latest post from each term using WP_Query
or get_posts
. You would may be need to sort the results for them to be in numerical line order and you will need transients to store your results as it can become an expensive query to run
Here are some posts you might find useful in connection with the above
-
Custom sort order with
get_terms
-> This post usesget_users
but you should be able to use this on get terms. I do thing it will be best first to create your tems in numerical order, one first and ten last, then you can simply use the build in sort by ID to sort your terms -
Using transients -> In this post I have explained well with code how to setup and use transients to save on db calls and time.
I hope the above info makes sense