title: Pagination on custom wp_query in WordPress takes to 404 error page
body: <p>Im have a loop with wp_query with the following code:</p>
  
  <pre><code>&lt;?php
      $temp = $wp_query;
      $wp_query= null;
      $wp_query = new WP_Query();
      $wp_query-&gt;query("showposts=2&amp;paged=$paged");
  ?&gt;
  
  &lt;?php if ($wp_query-&gt;have_posts()) : while ($wp_query-&gt;have_posts()) : $wp_query-&gt;the_post(); ?&gt;
      &lt;?php the_title() ?&gt;
  &lt;?php endwhile; ?&gt;
  &lt;?php else: ?&gt;
      &lt;article&gt;
          &lt;h2&gt;&lt;?php _e( 'Sorry, nothing to display.', 'theme' ); ?&gt;&lt;/h2&gt;
      &lt;/article&gt;
  &lt;?php endif;  my_pagination(); wp_reset_query()?&gt;
  </code></pre>
  
  <p>with standard pagination : </p>
  
  <pre><code>&lt;?php 
  function my_pagination()
  {
      global $wp_query;
      $big = 999999999;
      echo paginate_links(array(
          'base' =&gt; str_replace($big, '%#%', get_pagenum_link($big)),
          'format' =&gt; '?paged=%#%',
          'current' =&gt; max(1, get_query_var('paged')),
          'prev_text'    =&gt; __('&lt;i class="fa fa-chevron-left"&gt;&lt;/i&gt;'),
          'next_text'    =&gt; __('&lt;i class="fa fa-chevron-right"&gt;&lt;/i&gt;'),
          'total' =&gt; $wp_query-&gt;max_num_pages,
      ));
  }
  ?&gt;
  </code></pre>
  
  <p>The pagination is showing correctly on the page, but whenever I click on the pagination link it takes me to the error page.</p>
  
  <p>Tried everything now and have no idea what can be the reason for it.</p>
  
  <p>Amy help much apprecieated</p>