pilgrimish — 2012-06-28T17:53:13-04:00 — #1
I'm shooting to do something tricky with the Wordpress loop and I'm stumped as to how it may even be possible now.
I have a small box on the home page of a new website, serving up 6 "recent posts" using the "recent posts" widget. The same information is found on the "blog" page which features the loop.php feed, limited to 6 posts.
I'm using posts as products, beers to be exact. I want to give a beer tasting room the ability to update the most recent keg tapped by publishing a new post and pushing out the replaced keg. I overlooked the fact that each new post will simply push out the oldest post, instead of pushing out the specific keg that's been replaced.
My question is, and it is a BOLD ONE, is there a way for one to designate which post in the current 6 post feed gets replaced by the most recent post? Is this possible using a really macgyver take on WP_query or query_posts, or is it something that would involve more PHP or intense customization?
Any ideas or tips would be appreciated.
rhyswynne — 2012-06-29T05:23:44-04:00 — #2
Hmmmm.....for this I'd probably be tempted to do some sort of custom posts & custom variables.
So say you have:-
Beer 1 - Keg 1
Beer 2 - Keg 2
Beer 3 - Keg 3
The "Keg" will be a required custom variable. Then should you do Beer 4 (based on Keg 1), you should be able to do some WP Query to display of the latest post of each keg.
Does that make sense? Apologies I'm not getting technical, just getting my head around it myself!
pilgrimish — 2012-06-29T16:49:41-04:00 — #3
rhyswynne, sort of makes sense to me. I don't think I was entirely clear, or maybe it doesn't make as much sense as I thought it did.
Where are you getting Beer 1, 2 and 3 from? I think I scrambled you a bit with my description of the effort, though I do think you're leading this in the correct direction. Let me clarify.
Instead of publishing a brand new blog post that simply pushes out the oldest post to be published, how would it be possible to push out a post that's also determined from within the new post creation (within the Quickpress frame or the "Add new" post page), perhaps in a drop-down that offers the current 6 on tap, all before hitting "Submit?"
Instead of posting a brand new keg that simply pushes out the oldest keg to be tapped, how would it be possible to post a keg that's also determined from within the new keg creation (within the Quickpress frame or the "Add new" post page), perhaps in a drop-down that offers the current 6 kegs on tap, all before hitting "Submit?"
gwinh_dev — 2012-06-30T13:35:55-04:00 — #4
I suggest you create a custom post type for these reasons:
1. You wouldn't worry about querying your custom post type
2. You don't have to create a lot of custom coding in order to do what you want.
3. It is simple to manage in the backend