Title: rtquadros's Replies | WordPress.org

---

# rtquadros

  [  ](https://wordpress.org/support/users/rtquadros/)

 *   [Profile](https://wordpress.org/support/users/rtquadros/)
 *   [Topics Started](https://wordpress.org/support/users/rtquadros/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rtquadros/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rtquadros/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rtquadros/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rtquadros/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rtquadros/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Sort posts by custom post meta key AND post date with pagination](https://wordpress.org/support/topic/sort-posts-by-custom-post-meta-key-and-post-date-with-pagination/)
 *  Thread Starter [rtquadros](https://wordpress.org/support/users/rtquadros/)
 * (@rtquadros)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/sort-posts-by-custom-post-meta-key-and-post-date-with-pagination/#post-4391286)
 * Thank you for trying keesiemeijer! But your suggestion give me the same result.
 * If I don’t set ‘orderby’ in my query, I think for default, it sorts the post 
   by date DESC. But, when I set the sort by ‘action_votes_total’ the actions that
   have ‘votes’ shows up in the right order (from the most voted to the less), but
   the actions which don’t have any votes shows up in ASC order.
 * I just have the code running locally, but here is a [print from the problem](https://docs.google.com/file/d/0B1H60hlXP6nkVDhHc1dFTlJrLWs/edit),
   where you can see the action ‘teste 03’ in first (because it have one vote) and
   the rest of the posts in ASC order (they should be in DESC order).
 * Thanks again!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Sort posts by custom post meta key AND post date with pagination](https://wordpress.org/support/topic/sort-posts-by-custom-post-meta-key-and-post-date-with-pagination/)
 *  Thread Starter [rtquadros](https://wordpress.org/support/users/rtquadros/)
 * (@rtquadros)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/sort-posts-by-custom-post-meta-key-and-post-date-with-pagination/#post-4391125)
 * Hi, here is the thing: I have a ‘challenge’ post (that is where $challenge_ID
   come from) and inside it a list of ‘actions’. What I need is to sort this list,
   first by the number of votes each action have (‘action_votes_total’) and then
   by their date.

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