title: Pagination doesn't work on custom page index
body: <p>I've created a custom index page that only shows a specific category of posts. However the pagination doesn't seem to work on the custom index page. When clicking on the pagination it can't locate any page other than page 1. It only redirects to my 404 page. </p>
  
  <p>Here's my custom index page</p>
  
  <pre><code>&lt;?php
  /*
  Template Name: Funday
  */
  get_header(); ?&gt;
  
  
  &lt;div id="post" class="col span_8 clr"&gt;
  
  &lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/images/articlebar.png" alt="article bar" id="logo" style="margin-bottom: 10px" /&gt;
  
  &lt;?php query_posts ($query_string . '&amp;cat=funday'); ?&gt;
  &lt;?php
  if ( have_posts( )) :
      while ( have_posts() ) : the_post();
  
          get_template_part( 'content', get_post_format() );  
      endwhile;   
  endif;
  echo '&lt;div class="clear"&gt;&lt;/div&gt;';
  wpex_pagination(); ?&gt;
  &lt;/div&gt;&lt;!-- .span_8 --&gt;
  
  &lt;?php
  get_sidebar(article);
  get_footer();
  </code></pre>
  
  <p>Here's the pagination functions.</p>
  
  <pre><code>&lt;?php
  
  /**
   * Custom pagination function
   */
  
  if( ! function_exists('wpex_pagination') ) {
      function wpex_pagination() {
          global $wp_query;
          $total = $wp_query-&gt;max_num_pages;
          $big = 999999999; // need an unlikely integer
          if( $total &gt; 1 )  {
               if( !$current_page = get_query_var('paged') )
                   $current_page = 1;
               if( get_option('permalink_structure') ) {
                   $format = 'page/%#%/';
               } else {
                   $format = '&amp;paged=%#%';
               }
              echo paginate_links(array(
              'base' =&gt; str_replace( $big, '%#%', esc_url( get_pagenum_link( $big )  ) ),
              'format' =&gt; $format,
              'current' =&gt; max( 1, get_query_var('paged') ),
              'total' =&gt; $total,
              'mid_size' =&gt; 3,
              'end_size'     =&gt; 1,
              'type' =&gt; 'list',
              'prev_text' =&gt; '&amp;laquo;',
              'next_text' =&gt; '&amp;raquo;',
           ));
   }
   }
  }
  
  
  
  /**
   * Custom page entry pagination function
   *
   */
  
  function wpex_pagejump($pages = '', $range = 4) {
       $showitems = ($range * 2)+1; 
       global $paged;
       if(empty($paged)) $paged = 1;
  
       if($pages == '') {
           global $wp_query;
           $pages = $wp_query-&gt;max_num_pages;
           if(!$pages) {
               $pages = 1;
           }
       }  
  
       if(1 != $pages) {
          echo '&lt;div class="post-navigation clearfix"&gt;&lt;div class="alignleft"&gt;';
          previous_posts_link( '&amp;larr; ' . __('Newer Posts', 'wpex' ) );
          echo '&lt;/div&gt;&lt;div class="alignright"&gt;';
          next_posts_link( __('Older Posts', 'wpex' ) .' &amp;rarr;' );
          echo '&lt;/div&gt;&lt;/div&gt;';
       }
  }
  </code></pre>