title: Wordpress Pagination for a custom page template and custom post type
body: <p>Edited: Answered below.</p>
  
  <p>I'm using the following query to paginate my posts on a Custom Page template that pulls a Custom Post type. this exact code works on Author.php, but this custom template Page, "Filmmaking" does not show the pagination. I have a simple, tried and true pagination function after my loop. Why would it work for author.php, but not for page-filmmaking.php?</p>
  
  <pre><code>&lt;?php
  
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  $film_query = array( 
  'post_type' =&gt; 'filmmaking',   // Custom Post Type
  'paged' =&gt; $paged,       // Set it up to be paged so you can use pagination
  'posts_per_page' =&gt; 2,   // How many to show per page
  );
  
  // The Query
  $the_query = new WP_Query( $film_query );
  
  ?&gt;
  &lt;?php if ( $the_query-&gt;have_posts() ) : while ( $the_query-&gt;have_posts() ) : $the_query-&gt;the_post(); ?&gt;
  </code></pre>
  
  <p><strong>Answer: Get rid of if has_posts. 
  Working Code:</strong></p>
  
  <pre><code>&lt;?php
  /**
   * Template Name: pagination test
   */
  
  get_header(); ?&gt;
  &lt;?php //get_sidebar(); ?&gt;
  &lt;div id="page-left"&gt;
  &lt;?php
  $wp_query = new WP_Query();
  $wp_query-&gt;query(array(
  'post_type'=&gt;'filmmaking',
  'paged' =&gt; $paged,
  'posts_per_page' =&gt; 2,
  ));
  
  while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the_post(); ?&gt;
  
  &lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
  
  &lt;?php  endwhile; ?&gt;
  &lt;?php wp_reset_postdata(); ?&gt;
  
  &lt;?php previous_posts_link('&amp;laquo; Nyare') ?&gt;
  &lt;?php next_posts_link(' Äldre &amp;raquo;') ?&gt;
  
  &lt;/div&gt;&lt;!-- page left --&gt;
  &lt;?php get_footer(); ?&gt;
  </code></pre>