title: How to fix the custom wordpress tag pagination
body: <p>i had a problem with Category pagination and used that code to fix it but now i'm facing the same problem with tags,
  The problem is tag pagination gives me error 404
  here's the code</p>
  
  <pre><code>&lt;?php
  function remove_page_from_query_string($query_string)
  { 
      if ($query_string['name'] == 'page' &amp;&amp; isset($query_string['page'])) {
          unset($query_string['name']);
          // 'page' in the query_string looks like '/2', so i'm spliting it out
          list($delim, $page_index) = split('/', $query_string['page']);
          $query_string['paged'] = $page_index;
      }      
      return $query_string;
  }
  // I will kill you if you remove this. I died two days for this line 
  add_filter('request', 'remove_page_from_query_string');
  
  // following are code adapted from Custom Post Type Category Pagination Fix
  function fix_category_pagination($qs){
            if( (isset($qs['category_name']) || isset($qs['author_name']) || isset($qs['tag']) ) &amp;&amp; isset($qs['paged'])){
          $qs['post_type'] = get_post_types($args = array(
              'public'   =&gt; true,
              '_builtin' =&gt; false
          ));
          array_push($qs['post_type'],'post');
      }
      return $qs;
  }
  add_filter('request', 'fix_category_pagination');
  ?&gt;
  </code></pre>