Order events

Home Forums Calendar Products Events Calendar PRO Order events

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #81479
    connepon85
    Participant

    Hello there,

    first of all, I really love the plugin Events Calendar Pro! However, I have one problem. I show 3 events on my homepage and I want it to be the first three upcoming events. However, it shows the three last events (the ones that take place in a long time).

    I have tried adding some code to functions, but then it shows the latest events that I have added. I’m okay with that as well, however, the date then shows the publish date and not the date of when the even takes place.

    This is the code I added to functions as a second option:
    function tribe_post_date_ordering( $query ) {
    if ( $query->tribe_is_multi_posttype) {
    remove_filter( ‘posts_fields’, array( ‘TribeEventsQuery’, ‘multi_type_posts_fields’ ) );
    $query->set( ‘order’, ‘DESC’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );

    I hope you guys can help! The website is not online yet, I want to publish it within four days…

    #81559
    Barry
    Member

    The list widget shows upcoming events, so you could set it to display just 3 events. Is that an option here?

    #81562
    connepon85
    Participant

    Hey Barry,
    thank you for your quick reply! Unfortunately, that’s not really a solution for me, unless the appearance can be changed. I show the events next to each other as you can see in the screenshot below “Nieuwe evenementen”: http://www.paardenlifestyle.com/wp-content/uploads/2013/12/printscreen.jpg

    Any idea how I can get that result, but then with the first upcoming events?

    #81570
    Barry
    Member

    I see no reason why that wouldn’t be possible with the list widget, perhaps with only some custom styles.

    Other than that you could use tribe_get_events() as an alternative to working directly with WP_Query and set it to grab upcoming events – but with the list widget you would get this “for free” and can embed it outside of sidebars, if you need to, by using WordPress’s the_widget() function.

    Useful resources here:

    Hope that helps!

    #91026
    Barry
    Member

    It’s been a while so I’ll go ahead and close this thread. Of course if you need further help for this or any other issue please do feel free to create a new thread or threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Order events’ is closed to new replies.