Ussing page_navi with WP_Query
I'm ussing in my site that code:
category-anuncios.php
div class="listado-anuncios"
?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query=array("category_name"="anuncios","order"="ASC","posts_per_page"="1","page"=$paged);
$objAnuncio = new WP_Query($query);
if ($objAnuncio-have_posts()){
?
ul
?php
while($objAnuncio-have_posts()){
$objAnuncio-the_post();
?
li
?php
the_title();
?
/li
?php
}
?
/ul
?php
if (function_exists("wp_pagenavi")){wp_pagenavi(array("query"=$objAnuncio));}
wp_reset_postdata();
}
?
/div
I can see the content of my post well and show too the navigation...but, if I try to navigate to the second, third or other I have the error 404.
How can use that navigation with my custom query?
Edit:
Another way to test to fix the error:
Change the WP_Query for query_posts like that
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$categoria = $wp_query-query_vars["cat"];
query_posts('cat='.$categoria.'posts_per_page=1paged='.$paged);
But I've the same result: error 404
Topic plugin-wp-pagenavi navigation Wordpress
Category Web