Sort Events Grouped by month

Home Forums Calendar Products Events Calendar PRO Sort Events Grouped by month

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1402689
    bartmarkten
    Participant

    Hello ,

    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 page

    Also , 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.

    #1403507
    bartmarkten
    Participant

    Can you please Reply on this?

    #1404452
    bartmarkten
    Participant

    Guys , Could you please reply on this thread?

    I am actually stuck here , so really need your help!!

    #1405161
    Cliff
    Member

    Hi, 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

    #1410635
    bartmarkten
    Participant

    Hello ,

    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 date

    And I open page on 21/12/2017 date — then it should display in following order :
    Event1
    Event3
    Event2

    For now it is displaying in following order :
    Event1
    Event2
    Event3

    by 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.

    #1410815
    Cliff
    Member

    The 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.

    #1424747
    Support Droid
    Keymaster

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Sort Events Grouped by month’ is closed to new replies.