• Resolved mikoleg

    (@mikoleg)


    Ok, this is just annoying not to be able to find a solution for days already, i just cant find it. After creating custom post types and implementing basic pagination it just wont work for custom post types . I am not even starting another thread about that permalinks wont work as well…

    The funny thing i noticed is that pagination starts working only if you add real, normal posts.

    Here is the code and sorry if that will just sound like another stupid question to you:

    <?php
      $temp = $wp_query;
      $wp_query= null;
      $wp_query = new WP_Query(
    	array(
                'post_type' => 'portfolio',
                'posts_per_page' => 1,
                'paged' => $paged
            ));
      while ($wp_query->have_posts()) : $wp_query->the_post();
    
     ?>
    
    loop content goes here
    
     <?php endwhile; ?>
    
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi();  } $wp_query = null; $wp_query = $temp; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘custom post types pagination problems.’ is closed to new replies.