WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have support ticket system which i have built using wordpress.

The basic functionality is that when a "ticket" is created, it creates a post. When an admin replies, it then add a child post to the original post.

My question is how can i order my posts by the child post_date is ASC order?

My query args at the moment are:

$args = array(
  'post_type' => 'support_tickets',
  'numberposts' => -1,
  'post_parent' => 0,
  'orderby' => 'date',
  'order' => 'DESC'  );

This only obviously orders the parent post's in ASC by date. Is what i require achievable?

share|improve this question
I imagine that you could get this to work with enough effort, but I am not sure you could get it to work efficiently. You are talking about a lot of tricky SQL and/or PHP manipulation of the data. I would suggest that your design is going to cause you a lot of pain. Use comments, or a custom built table/interface. – s_ha_dum Nov 27 '13 at 15:50
@s_ha_dum yes i did imagine it would be a lot of work and headache... i will spend some more time looking into it, and if no joy i will go down the route of using comments or another custom solution – danyo Nov 27 '13 at 16:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.