I have this code:

$wp_query = new WP_Query(array('posts_per_page'=> 10,'post_type' => 'dirdeservicios', 'paged' => $paged, 'meta_query' => array(
                                                                                   array(
                                                                                       'key' => 'tipoCuenta',
                                                                                       'value' => 'personanatural'
                                                                                   )), 'orderby' => 'title', 'order' => 'ASC'));

which paginates various posts. The problem is, instead of receiving this:

page -> posts

1 -> A,A,A,A,B,B,B,B

2 -> C,C,C,C,D,D,D,E

3 -> E,E,E,F,F,F

I’m receiving this:

1 -> A,A,B,B,P,V

2 -> A,A,A,A,B,B

3 -> C,C,C,D,D,D

I’m totally clueless about what’s happening here. I’m sorting them by ASC and TITLE… but they are not being sorted correctly!

Is my wp_query well formed?

Read more here: wp_query pagination not sorting correctly


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: