Home › Forums › Calendar Products › Events Calendar PRO › Change sort order of events
- This topic has 6 replies, 2 voices, and was last updated 6 years, 2 months ago by agrabemeyer.
-
AuthorPosts
-
January 10, 2018 at 2:45 pm #1423062agrabemeyerParticipant
I would like items to sort alphabetically by day and not chronologically if possible. How do I change this?
January 11, 2018 at 9:06 pm #1424335BrendanKeymasterHello Pam and welcome back ?
Can you copy/paste the following snippet and replace the code you provided in your functions.php file and let me know if events are sorting alphabetically in photo view. Please test the code using the default WP theme and only our plugins activated.
Let me know if it helps and thanks for choosing PRO!
add_filter( 'pre_get_posts', 'tribe_change_event_order', 99 );
function tribe_change_event_order( $query ) {
if ( tribe_is_past() || tribe_is_upcoming() || tribe_is_photo() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
return $query;
}
January 23, 2018 at 12:04 pm #1433915agrabemeyerParticipantI don’t see any of your code in my functions.php file. Where do I need to insert it please?
-Andi
- This reply was modified 6 years, 2 months ago by agrabemeyer.
January 24, 2018 at 3:51 pm #1435251agrabemeyerParticipantI just copied and pasted the code you gave and it did not work. Please advise.
January 26, 2018 at 7:20 pm #1437703BrendanKeymasterHi there,
That is our snippet for sorting alphabetically. You can custom development an option but it would require custom coding and recreating some of our templates to accomplish this.
If you only need to change it for the list view, the template override approach is ok. Most probably the template override is not working at all. Please check that the override is in the correct path, it should be at ‘wp-content/[your_theme]/tribe-events/list/content.php’. If you are still not sure about this process, please check Themer’s Guide.
Customizations are not supported so you would need to find a developer to accomplish this.
Thanks,
Brendan
February 18, 2018 at 8:35 am #1456950Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Change sort order of events’ is closed to new replies.