• I am hoping someone in the community can point me in a better direction. I currently have a featured section that contains 4 posts that are manually programmed using an AJAX search posts field that allows a user to put any post in any of the 4 featured spots.

    I am now having to add date scheduling functionality to this featured section and struggling to decide the best route to go. I know there are a few options frameworks out there that have many of the fields needed for a settings page such as repeaters date/time etc.. however many of them don’t support the functionality of sorting by dates, removing expired dates and checking to see if multiple of the same dates exist.

    Could someone maybe point me to a javascript library or another resource that may help in the assistance of a solution? I’m pretty sure I will not be able to do this in the customizer as there is more advanced features needed, however I would integrate this on it’s own settings page.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    I think you mainly just need to store the timestamp when a post is to become featured in its postmeta. To get the featured posts for output, query for the 4 posts whose postmeta is at or before the current time, ordered by the postmeta field.

    There’s no need to worry about expired dates as long as there’s four more recent posts to display. Older posts will never be returned by the query. If there should be more than 4 posts with the same timestamp, SQL will return the first 4 posts found meeting all criteria. To get different results, specify a secondary sort order such as descending publish date to get the most recent posts that are also featured posts.

    I don’t see why this couldn’t be done in the customizer, but I don’t think it belongs there anyway. In my mind the customizer is for altering theme appearance, not selecting content. For me, I think such an interface belongs under posts. In fact, it could make sense to have input fields on the post edit screen and the dedicated page is more of a featured post summary screen, though fields could be altered here as well. Just my thoughts, I’ve been told many times I don’t think like typical users, so I may not be the best resource for UI design.

    Thread Starter coleh3

    (@coleh3)

    Thank you for the response.

    The issue is I want to create one UI space where the featured posts can be scheduled. This will take away from someone having to go through multiple post types to find posts to schedule in the featured area. It will also present a better way to see the overall picture of what’s scheduled and where it is. Unless there is an easy way to use one settings page to update and add post meta to the posts so that way it can be done from the post itself or from the one settings page.

    Moderator bcworkz

    (@bcworkz)

    Sure, that’s possible too. I was really just suggesting how to manage the data. How you collect it is up to you. The all in one place scheme works great if the user knows what they want. If not, they would end up sifting through posts anyway, which is why I thought fields on the edit screen could work. Another possibility are fields in the quick edit view. You don’t need to do it these ways, they were merely suggestions. The timestamp in postmeta concept works with any of these.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating A Scheduled Featured Post Section’ is closed to new replies.