title: Using pagination with wp-query 'post_type'
body: <p>I am having trouble getting pagination to work. I have read all the help but can't seem to apply it very well.</p>
  
  <p>Here's a pastie for the page.</p>
  
  <p><a href="http://pastebin.com/L12bJ6Zn" rel="nofollow noreferrer">http://pastebin.com/L12bJ6Zn</a></p>
  
  <p>I had a look at this, <a href="https://stackoverflow.com/questions/19985312/wordpress-pagination-issue-with-post-typepage">Wordpress pagination issue with post_type(&#39;page&#39;)</a> but I could not see how he did it, perhaps I am missing somthing in my new Wp_Query,</p>
  
  <p>The code commented out was another test I tried which did not work. I also tried the plugin 
  pagenavi which I could also not get to work.</p>
  
  <pre><code>&lt;?php
  
  /*
  
  Template Name: News Page
  
  
  */
  
  
  get_header(); ?&gt;
  
  &lt;div class="container"&gt;
          &lt;ol class="col-md-4 breadcrumb"&gt;
                  &lt;li&gt;&lt;a href="&lt;?php echo get_site_url(); ?&gt;"&gt;Home&lt;/a&gt;&lt;/li&gt;
                  &lt;li  class="active"&gt;News&lt;/li&gt;
          &lt;/ol&gt;
  &lt;/div&gt;
  &lt;?php
  $args = array (
          'post_type' =&gt; 'news',
          'posts_per_page' =&gt; 2
          );
  
  $the_query = new WP_Query( $args );
  ?&gt;     
  
  &lt;?php
  $posts =1;
  ?&gt;
  
  &lt;div class="container news"&gt;
  
          &lt;div class="col-md-3"&gt;
  
                  &lt;?php
                  if ($posts == 1) {
                          global $wp_query;
                          $postid = $wp_query-&gt;post-&gt;ID;
                          get_post_meta($postid, 'title_youtube_link', true);
                          wp_reset_query();
  
                          echo '&lt;h5&gt;';
                          echo the_field('title_youtube_link');
                          echo'&lt;/h5&gt;';
  
                          global $wp_query;
                          $postid = $wp_query-&gt;post-&gt;ID;
                          get_post_meta($postid, 'youtube_link', true);
                          wp_reset_query();
  
                          $meta = get_post_meta(get_the_ID(), 'video', true);
                          $content = apply_filters('the_content', get_field('youtube_link') );
                          echo $content;
  
                          the_content();
                          echo '&lt;div style="padding-top: 35px;"&gt;&lt;/div&gt;';
                          dynamic_sidebar('news_taxonomy');
                          echo '&lt;div style="padding-bottom: 35px;"&gt;&lt;/div&gt;';
                  }
                  $posts++; ?&gt;
          &lt;/div&gt;
          &lt;div class=" col-md-8 col-md-offset-1"&gt;
  
                  &lt;script&gt;
                          boxes = $('.news-height');
                          minHeight = Math.min.apply(
                                  Math, boxes.map(function() {
                                          return $(this).height();
                                  }).get());
                          boxes.height(minHeight);
                  &lt;/script&gt;
  
                  &lt;?php if ( have_posts() ) : while ( $the_query-&gt;have_posts()  ) : $the_query -&gt; the_post(); ?&gt;
  
                          &lt;div class=" news-style well" &gt;
  
                                  &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;h4 class="bold_this"&gt;&lt;?php the_field('title_of_the_news'); ?&gt;&amp;rarr;&lt;/h4&gt;&lt;/a&gt;
  
                                  &lt;ul class="info"&gt;
                                          &lt;li&gt;Posted in: &lt;?php echo get_the_term_list( $post-&gt;ID, 'news_type','',','); ?&gt; &lt;/li&gt;
                                          &lt;li&gt;Added by: &lt;a href="&lt;?php bloginfo('siteurl') ;?&gt;/about/"&gt;&lt;?php the_author(); ?&gt;&lt;/a&gt;&lt;/li&gt;
                                          &lt;li&gt;On: &lt;?php the_time('F j, Y'); ?&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                                  &lt;br&gt;&lt;br&gt;
                                  &lt;?php the_field('content_of_the_news'); ?&gt;
                          &lt;/div&gt;
                  &lt;?php endwhile; endif; ?&gt;
  
                   &lt;!-- posts_nav_link(' — ', __('&amp;laquo; Newer Posts'), __('Older Posts &amp;raquo;'));  --&gt;
                   &lt;?php wp_pagenavi(); ?&gt;
  
          &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;?php get_footer();?&gt;
  </code></pre>