I'm doing the index of a site and in it I do a search of the posts, alias several searches, and the last of them has pagination that is the last registered posts.
I'm doing the query as follows:
<?php query_posts(array('posts_per_page' => 2, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1), 'meta_query' => array(array('key' => 'destaque', 'value' => 'on', 'compare' => 'NOT EXISTS')))); ?>
Then after the while I put:
<?php echo paginate_links(); ?>
It shows the two page posts and pagination links, but it goes to 404. What can it be?