Events ordering

Home Forums Calendar Products Events Calendar PRO Events ordering

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #973429
    Kathryn
    Participant

    Even thought this has been added to my site and until today the ordering was correct – all of a sudden it has reverted back to the incorrect order – can you help please – Also I would like to add a line between each event as per the blog posts

    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );

    function tribe_post_date_ordering( $query ) {
    if ( ! empty( $query->tribe_is_multi_posttype ) ) {
    remove_filter( ‘posts_fields’, array( ‘Tribe__Events__Query’, ‘multi_type_posts_fields’ ) );
    $query->set( ‘order’, ‘DESC’ );
    }
    }

    #973624
    Nico
    Member

    Hi Kathryn,

    Thanks for reaching out to us! Sorry to hear that snippet stopped working 🙁

    Did you update our plugins or made a significant change in your site? What version of the plugins are you using?

    I would like to add a line between each event as per the blog posts

    I’m not sure about this, you mean like a divider? Can you point me to a URL so I can see this?

    Looking forward to solving this,
    Best,
    Nico

    #976017
    Kathryn
    Participant

    Sorry I hadnt responded

    If you take a look at http://www.100percentplussize.com look under each blog post there is a small line which divides each post – when the events come into a blog loop that doesnt appear so each one is close to another – cant show you on http://www.letsgoloco.co.uk as the site is having a problem

    #976116
    Nico
    Member

    Kathryn,

    Thanks for the follow up!

    Adding the line should be simple, just adding a couple of lines to the css file of your theme will do the trick. It would be great if you could send me a link where I can see the site markup (posts + events in the listing) that way I can craft the CSS snippet for you. Do you think that’s possible?

    Thanks,
    Nico

    #976214
    Kathryn
    Participant

    HI if you give me an email address I will set you up as an admin user so you can go in and view

    #976237
    Nico
    Member

    Kathryn,

    Sorry to say we are not allowed to login into client sites. I meant a link to the front end of the site were I can see the posts + events list. If you want you can mark your reply as private that way the link doesn’t get publicly visible.

    Thanks,
    Nico

    #976588
    Kathryn
    Participant

    http://www.letsgoloco.co.uk/- here is the site Nico

    You will notice that the events are not in order of date of production but date of event – I added the following code in ages ago and it was working fine until last week when it reverted back to how it is now – this has been copied from my theme functions php file any idea what is wrong ??

    return $field;
    }
    add_filter(‘acf/load_field/name=promotions’, ‘tdp_restrict_custom_field’);
    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );
    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’ );
    }
    }
    Thanks

    #976589
    Kathryn
    Participant

    Just clicked on the web link I have just added and it goes to the wrong page here it is http://www.letsgoloco.co.uk/

    #984578
    Nico
    Member

    Hi Kathryn,

    Thanks for the follow-up!

    To get that ‘divider’ on events to please modify line 871 of your theme’s stylesheet (located at ‘wp-content/themes/atlas/style.css’):

    // this is line 871 now
    #content-container article.post {
    // to also include events, it should be
    #content-container article.post, #content-container article.tribe_events {

    Changing that line should do the trick!

    Regarding events ordering, I’m a bit confused: Do you want them to be ordered by publish date? That meaning the last event you publish goes first?

    Please let me know,
    Best,
    Nico

    #984958
    Kathryn
    Participant

    I had a piece of code from you that meant when a post was published on that day – eg if the event was published on 7th July 2014 but the day of the event -and it was working absolutely fine then all of a sudden it isnt working – not sure why ??

    This was the code I was given
    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );
    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’ );
    }
    }

    Thanks

    #984960
    Kathryn
    Participant

    The line is now working thanks – just re uploaded my function php file and added your code and it still isnt working ?

    #984963
    Kathryn
    Participant

    sorted it thanks

    #985432
    Geoff
    Member

    Thanks for the confirmation, Kathryn! Nico is out today, but I just wanted to poke in to thank you for following up here. Please feel free to hit us up with a new thread if anything else comes up and we’d be happy to help. 🙂

    Cheers!
    Geoff

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Events ordering’ is closed to new replies.