Home › Forums › Calendar Products › Events Calendar PRO › Sort Events Grouped by month
- This topic has 7 replies, 2 voices, and was last updated 8 years, 3 months ago by
bartmarkten.
-
AuthorPosts
-
December 11, 2017 at 3:41 am #1402689
bartmarkten
ParticipantHello ,
I am using Events Calendar PRO plugin and I want to list Upcoming events Group by
1) Month on one page and
2) Week on one pageAlso , I am using “tribe_get_events” function with required arguments to list events ,
I am a developer , so can make changes in filter/action hooks or use required arguments from WP-Query or get_posts function.
Can you help me how i can list events like above requirement.
As an example :
1) For Month :
“January”
{here all events of january}“february”
{here all events of february}2) For Week :
“Monday”
{here all events on Monday}“Tuesday”
{here all events on Tuesday}Please get back to us as soon as possible.
Thanks.
December 12, 2017 at 4:51 am #1403507bartmarkten
ParticipantCan you please Reply on this?
December 13, 2017 at 4:51 am #1404452bartmarkten
ParticipantGuys , Could you please reply on this thread?
I am actually stuck here , so really need your help!!
December 13, 2017 at 7:55 pm #1405161Cliff
MemberHi, Bart. So sorry for the delayed reply here. I’m unsure how this happened, but I’ll be sure to keep up with this thread for you.
https://theeventscalendar.com/knowledgebase/using-tribe_get_events/#all-events-in-time-range is an example of “Get all events in a specific time range”
Is this the information you’re looking for?
To really assist further, I’d need to see what code you already have.
FYI: another alternative might be to use the tribe_events shortcode, particularly the “date” argument: https://theeventscalendar.com/knowledgebase/embedding-calendar-views-tribe_events-shortcode/#common
December 21, 2017 at 2:16 am #1410635bartmarkten
ParticipantHello ,
By using following code :
$todays_events = tribe_get_events( array(
‘posts_per_page’ => -1,
‘start_date’ => date( ‘Y-m-d H:i:s’ )
) );We are getting all upcoming events but we want this in Ascending order of start date like as an example i am having 3 events :
Event1 – 21/12/2017 is start and end date
Event2 – 23/12/2017 is start date and 25/12/2017 is end date
Event3 – 21/12/2017 is start date and 23/12/2017 is end dateAnd I open page on 21/12/2017 date — then it should display in following order :
Event1
Event3
Event2For now it is displaying in following order :
Event1
Event2
Event3by taking post_date as an orderby parameter.
Please let me know how can I achieve results as shown above using “tribe_get_events” or nay other function provided by your plugin.
December 21, 2017 at 6:58 am #1410815Cliff
MemberThe last snippet at https://paulund.co.uk/order-meta-query should be helpful to you. https://codex.wordpress.org/Class_Reference/WP_Meta_Query may be of help to you as well.
Another idea is that you may be able to get away with simply doing the same as https://github.com/moderntribe/the-events-calendar/blob/4.6.8/src/Tribe/Query.php#L387 — but replacing __CLASS__ with Tribe__Events__Query
Please let me know how this goes for you.
January 12, 2018 at 8:36 am #1424747Support 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 ‘Sort Events Grouped by month’ is closed to new replies.
