Home › Forums › Calendar Products › Events Calendar PRO › Events ordering
- This topic has 12 replies, 3 voices, and was last updated 10 years, 10 months ago by
Geoff.
-
AuthorPosts
-
June 29, 2015 at 1:36 am #973429
Kathryn
ParticipantEven 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’ );
}
}June 29, 2015 at 12:02 pm #973624Nico
MemberHi 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,
NicoJuly 6, 2015 at 5:00 am #976017Kathryn
ParticipantSorry 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
July 6, 2015 at 7:21 am #976116Nico
MemberKathryn,
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,
NicoJuly 6, 2015 at 10:05 am #976214Kathryn
ParticipantHI if you give me an email address I will set you up as an admin user so you can go in and view
July 6, 2015 at 11:39 am #976237Nico
MemberKathryn,
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,
NicoJuly 7, 2015 at 4:01 am #976588Kathryn
Participanthttp://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’ );
}
}
ThanksJuly 7, 2015 at 4:03 am #976589Kathryn
ParticipantJust clicked on the web link I have just added and it goes to the wrong page here it is http://www.letsgoloco.co.uk/
July 7, 2015 at 2:42 pm #984578Nico
MemberHi 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,
NicoJuly 9, 2015 at 1:24 am #984958Kathryn
ParticipantI 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
July 9, 2015 at 1:57 am #984960Kathryn
ParticipantThe line is now working thanks – just re uploaded my function php file and added your code and it still isnt working ?
July 9, 2015 at 2:57 am #984963Kathryn
Participantsorted it thanks
July 10, 2015 at 9:22 am #985432Geoff
MemberThanks 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 -
AuthorPosts
- The topic ‘Events ordering’ is closed to new replies.
