Title: CHANGE DISPLAY ORDER
Last modified: August 30, 2016

---

# CHANGE DISPLAY ORDER

 *  Resolved [rafaelvidal](https://wordpress.org/support/users/rafaelvidal/)
 * (@rafaelvidal)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/change-display-order/)
 * I’m using categories of events on my website menu.
    So, for the category: “meetings”
   I have a “Meetings” button on the menu. General events are displayed under the“
   Events” button.
 * I could reverse the order of all events using this function:
 *     ```
       add_action('pre_get_posts','wpse50761_alter_query',15);
       function wpse50761_alter_query($query){
       if( $query->is_main_query() && is_post_type_archive('event')){
       	$query->set('orderby','eventstart');
       	$query->set('order','DESC');
       	}
       }
       ```
   
 * But I couldn’t figure out how to reverse order of categories (“meetings”, “promotions”).
 * **MENU STRUCTURE**
 *     ```
       Home
       Contact
       About Us
         Team
         Company
       Events (/events/event/)
         Meetings (events/category/meetings/)
         Promotions (events/category/promotions/
       ```
   
 * [https://wordpress.org/plugins/event-organiser/](https://wordpress.org/plugins/event-organiser/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [rafaelvidal](https://wordpress.org/support/users/rafaelvidal/)
 * (@rafaelvidal)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/change-display-order/#post-6667585)
 * RESOLVED
 *     ```
       add_action('pre_get_posts','wpse50761_alter_query',15);
       function wpse50761_alter_query($query){
       if( $query->is_main_query() && is_post_type_archive('event') || is_tax('event-category') ){
       	$query->set('orderby','eventstart');
       	$query->set('order','DESC');
       	}
       }
       ```
   
 * changed “if” row; added ” || is_tax(‘event-category’) ” at the end of the _if
   condition_.

Viewing 1 replies (of 1 total)

The topic ‘CHANGE DISPLAY ORDER’ is closed to new replies.

 * ![](https://ps.w.org/event-organiser/assets/icon-256x256.png?rev=978123)
 * [Event Organiser](https://wordpress.org/plugins/event-organiser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-organiser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-organiser/)
 * [Active Topics](https://wordpress.org/support/plugin/event-organiser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-organiser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-organiser/reviews/)

## Tags

 * [descending](https://wordpress.org/support/topic-tag/descending/)
 * [reverse](https://wordpress.org/support/topic-tag/reverse/)

 * 1 reply
 * 1 participant
 * Last reply from: [rafaelvidal](https://wordpress.org/support/users/rafaelvidal/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/change-display-order/#post-6667585)
 * Status: resolved