Im creating a WP for a custom type post in a page template:


                global $paged;
                global $notquery;
                $temp = $notquery; 
                $notquery = null; 

                $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 

                $args = array(
                    'post_type' => 'noticias',
                    'paged' => $paged,
                    'posts_per_page' => 1


                $notquery = new WP_Query($args); 

                while ( $notquery->have_posts() ) :
                    global $post;

And it just dont works properly. I can access page 2 with /page/2/. So, paged seems to work. It prints out the wp-paginate navigation div, but nothing inside it.

   <div class="navigation"></div>

Whats the problem guys? thanks!

  • What function or method are you using for the navigation links? Why are you setting $notquery to null? You also need to be using wp_reset_postdata() – Chris_O Apr 17 '13 at 3:36
  • Found the problem. It worked pretty well with query_posts(). Thanks! – Lucas Veiga Apr 17 '13 at 18:21
  • See wordpress.stackexchange.com/questions/4696/… for a proper solution. – fuxia Apr 17 '13 at 18:24

It worked with query_posts(). Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.