I’d like to have a featured blog post on the posts listing page. The thing is that it should be user selectable which post should be featured and there can only be one featured post. How would I best achieve that?
The only thing I can think of right now is a toggle or checkbox to set a post as featured but that would require to uncheck potential other posts manually. Is there an automatic way to set a single post only to featured?
You could use a hook that checks if another post is already selected and then update that an set the toggle to false.
I would select the featured article on the parent blog page. So I don’t need to update any (other) article page.
Right, that probably makes more sense. I’m going to try that.
Thanks for your quick replies.
3.3.0 (currently in RC-2 state, release in about 2 weeks) will add a search fields to files, pages and users fields, making it a lot easier to find the required page when there are a lot of subpages.
Hm, OK, I got the featured post as page select field in the parent page panel and also the output in the template. The question now is how do I exclude that post from the regular list in the template? Since it doesn’t have any special status I can’t address the featured post specifically. Or is there a solution I haven’t thought about yet?
Edit: Hm, I’m thinking that I could check whether the current post’s slug in the loop is the same as the slug of the featured post, or something like that. Does that sound feasible?
Edit 2: YES, it seems to work!