Home › Forums › Calendar Products › Events Calendar PRO › Show Events By Published Date?
- This topic has 5 replies, 2 voices, and was last updated 8 years, 6 months ago by
Adam.
-
AuthorPosts
-
September 21, 2017 at 4:34 pm #1353092
Adam
ParticipantIs there a way to list events in order by the date they were published to the calendar. More specifically it would be great to have a widget to show the latest events published on my website’s sidebar/home page.
I run a music website and use The Events Calendar for concert listings and want to show the latest events published on the home page so it can be like a “Concert Announcements” section. Right now I have to publish to the calendar and then make a separate duplicate blog post to announce new shows.
I tried the “Include events in main blog loop” setting a long time ago and I could never get it to show by publish date. It always showed the events that were furthest date away first.
September 25, 2017 at 7:04 am #1354248Jennifer
KeymasterHi Adam,
Thanks for reaching out!
Unfortunately there is not currently an out-of-the box way to order the events by publish date, but you might try using the [display-posts] shortcode. The post type for events is ‘tribe_events’.
You can also use WP_Query or tribe_get_events() to create a custom events list, but if you want to display it in a section on your home page, I think the shortcode would be the easiest way.
Let me know how that works for you and if you have any questions!
Thanks,
Jennifer
September 26, 2017 at 1:29 pm #1355194Adam
ParticipantUsing the shortcode doesn’t order the events by when they were published to the calendar. This is the shortcode I tried.
[display-posts post_type=”tribe_events” posts_per_page=”20″ order=”DESC” orderby=”date”]I have also tried orderby=”ID” and orderby=”modified” and it doesn’t change the order.
All it does is list events in order of the date they’re listed on the calendar. An event that’s listed for December 14th that I published on September 6th is constantly shown first by the shortcode, while an event I published this morning (September 26) that’s happening November 10th is 11th down on the list by the shortcode.
If I were to publish a new event that’s dated for February of next year that will end of at the top of the list and sit at the top of the list no matter how many other events I publish to the calendar that are happening at an earlier date.
September 28, 2017 at 6:43 am #1356060Jennifer
KeymasterHi Adam,
I’m sorry that didn’t work for you. You can try using “post_date” or “modified” for the orderby parameter with the shortcode, or you could also try a plugin like WP Latest Posts (I haven’t tested it out, but it looks like it might do what you’re looking for). There appear to be several plugins out there that help you display posts with a custom sort order, so I’d recommend doing a search for a similar plugin if that one doesn’t work for you. Otherwise, I’m afraid you’ll need to go with WP_Query or tribe_get_events(). If you go this route, I’d also recommend taking a look at our themer’s guide to help with the customization.
I’m sorry I don’t have a more straight-forward solution for you here, but I hope this helps!
October 20, 2017 at 9:36 am #1366570Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Show Events By Published Date?’ is closed to new replies.
