Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 –  dan Nov 27 '13 at 16:00

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.