Title: Ordering post
Last modified: April 21, 2018

---

# Ordering post

 *  Resolved [AngeloLazzari](https://wordpress.org/support/users/angelolazzari/)
 * (@angelolazzari)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/ordering-post/)
 * Hi i woild like to use your plugin but is there a way to order all the post of
   a specific category by the event start date?
 * Than you very much

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Manuel Schmalstieg](https://wordpress.org/support/users/targz-1/)
 * (@targz-1)
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10259344)
 * Hi Angelo,
 * That’s a great question. First, here is a working example of code for what you
   want to do:
 *     ```
       function mem_category_order( $query ) {
         if ( $query->is_category('events') ) {
   
         	$query->set( 'meta_key', '_mem_start_date');
         	$query->set( 'orderby', 'meta_value');
   
         }
       }
       add_filter( 'pre_get_posts', 'mem_category_order' );
       ```
   
 * [https://gist.github.com/ms-studio/b3919690c95daaa1503ea9a949a0767d](https://gist.github.com/ms-studio/b3919690c95daaa1503ea9a949a0767d)
 * This example will order posts of the category with slug “events” by their start
   date.
 * Caveat: this Category Archive will now only show articles that have a start date.
 * Second, in the plugin’s wiki, there are some deeper considerations on how to 
   handle archives and event dates:
 * [https://github.com/ms-studio/minimalistic-event-manager/wiki/Implementation-strategy](https://github.com/ms-studio/minimalistic-event-manager/wiki/Implementation-strategy)
 *  Thread Starter [AngeloLazzari](https://wordpress.org/support/users/angelolazzari/)
 * (@angelolazzari)
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10264950)
 * Thank you very much Manuel!!! i will try it! thanks!
 *  Thread Starter [AngeloLazzari](https://wordpress.org/support/users/angelolazzari/)
 * (@angelolazzari)
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10268760)
 * Hi Manuel, i create this test site [http://test.redtulp.com](http://test.redtulp.com)
   and i create 4 post too… 3 of the category events should be ordered by your code
   that i put in the funcion… but for some reason it’s not working,… i mean, it 
   should be order the events by the start date ( that is the same date of the title)….
   but no…not working… you can see even the hello world post that is an uncategorized
   post….
 * see here [http://test.redtulp.com/eventos/](http://test.redtulp.com/eventos/)
 * thank you very much
    Angelo
    -  This reply was modified 8 years ago by [Geoffrey Shilling](https://wordpress.org/support/users/geoffreyshilling/).
 *  [Geoffrey Shilling](https://wordpress.org/support/users/geoffreyshilling/)
 * (@geoffreyshilling)
 * Volunteer Moderator
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10269297)
 * I have removed your offer to create an admin account on your test site. I understand
   it may be just a test site, but that’s still not a good thing to do. As Jan put
   it on [another thread](https://wordpress.org/support/topic/no-checkout-form-in-admin/#post-9492495),
 * > The internet is a wonderful place full of very nice people and a few very bad
   > ones. I’m sure everyone here is very nice however, by giving some ones keys
   > to your house you are trusting they wont steal anything. Likewise the person
   > who takes the keys is now responsible for the house FOREVER.
    -  This reply was modified 8 years ago by [Geoffrey Shilling](https://wordpress.org/support/users/geoffreyshilling/).
 *  Thread Starter [AngeloLazzari](https://wordpress.org/support/users/angelolazzari/)
 * (@angelolazzari)
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10269352)
 * so how i can comunicate with Manuel to solve the problem? thank you very much!
   
   Angelo
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10269441)
 * Not that way. Please _do not repeat that offer again_. Honestly. The author will
   get into real trouble here for accepting that offer from you. Please so not make
   that offer again.
 * [https://wordpress.org/support/guidelines/#the-bad-stuff](https://wordpress.org/support/guidelines/#the-bad-stuff)
 * There are many ways to get information the author needs and that author accessing
   the user’s site is not one of them. That’s going too far.
    - Install the [Health Check plugin](https://wordpress.org/support/plugin/health-check/)
      and get the data to the author that way.
    - Provide a link to the [http://pastebin.com/](http://pastebin.com/) log of 
      the user’s web server error log.
    - Create and post a link to your `phpinfo();` output.
    - Enable [WP_DEBUG and log that output to a file and share a link that file.](https://codex.wordpress.org/WP_DEBUG#WP_DEBUG_LOG_and_WP_DEBUG_DISPLAY)
    - Walk basic troubleshooting steps such and disabling all other plugins, clear
      their cache and cookies and try again.
    - Provide step-by-step on how they can reproduce the problem.
 * You get the idea.
 * Volunteer support is not easy. But these forums need to a safe place for all 
   users, experienced or new. Accessing their system that way is a short cut that
   will get you into real trouble in these forums.
 *  Thread Starter [AngeloLazzari](https://wordpress.org/support/users/angelolazzari/)
 * (@angelolazzari)
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10270114)
 * ok i got it thank you very much!!!
 * Angelo
 *  Plugin Author [Manuel Schmalstieg](https://wordpress.org/support/users/targz-1/)
 * (@targz-1)
 * [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10271491)
 * Hi Angelo,
 * As the moderators said, please don’t post login info on this forum. Also, I don’t
   have time available to look into issues with such detail.
 * That said, from what I can see on your test site, the custom ordering on the “
   Eventi” category page is actually working – see here:
 * [http://test.redtulp.com/category/eventi/](http://test.redtulp.com/category/eventi/)
 * In order to link to this page, the Menu builder allows you to use Categories 
   as menu items.
 * I hope this helps. I won’t be able to give you more specific advice, sorry.
 * Best,
    Manuel

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Ordering post’ is closed to new replies.

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

 * 8 replies
 * 4 participants
 * Last reply from: [Manuel Schmalstieg](https://wordpress.org/support/users/targz-1/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/ordering-post/#post-10271491)
 * Status: resolved