Home › Forums › Calendar Products › Events Calendar PRO › Events Calendar Pro + Mantra theme: event posts order.
- This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by Brian.
-
AuthorPosts
-
November 28, 2014 at 4:08 am #901047pacovidalParticipant
Hello,
I have a nwe site using the Events Calendar Pro. Events posts show up in the main loop, which is great, but the show up from the last to start to the newest. I would like to have them in reverse order, or at least from the last to be posted to the oldest.
I have found a solution you gave to someone else by means of this code: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’ );
}
}However, when I tried to insert it in the funcions.php of my theme I get a bunch of errors in the page and Events Calendar widgets. Surely I am doing it wrong, because I am not a programmer at all. Would you please help me?
Thanks in advance!
November 29, 2014 at 7:21 am #901922BrianKeymasterHi,
Sorry for the issues you are having with this snippet. Could you provide a link to where you got the snippet from so I can see the context in which they gave it.
Also can you share the errors you are getting.
Let me know and we can go from there.
Thanks
December 1, 2014 at 1:19 am #903537pacovidalParticipantHi, Brian.
I got the snippet from your support site: https://theeventscalendar.com/support/documentation/order-events-in-main-blog-loop-by-post-date/But… now it works ok! I phone mi hosting provider and it seems it was a server error. Thank you very much for your help!
December 1, 2014 at 8:14 am #903844BrianKeymasterI am glad to see you were able to fix this issue.
Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘Events Calendar Pro + Mantra theme: event posts order.’ is closed to new replies.