Title: jointplan's Replies | WordPress.org

---

# jointplan

  [  ](https://wordpress.org/support/users/jointplan/)

 *   [Profile](https://wordpress.org/support/users/jointplan/)
 *   [Topics Started](https://wordpress.org/support/users/jointplan/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jointplan/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jointplan/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jointplan/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jointplan/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jointplan/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [404 error on 2nd page of blog after 3.4 upgrade](https://wordpress.org/support/topic/404-error-on-2nd-page-of-blog-after-34-upgrade/)
 *  [jointplan](https://wordpress.org/support/users/jointplan/)
 * (@jointplan)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/404-error-on-2nd-page-of-blog-after-34-upgrade/page/2/#post-2825555)
 * I’m experiencing the same issue and have implemented near on all code examples
   and modified versions of them with no luck.
 * I’ve posted the [details on this post](http://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore?replies=14)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [After WP 3.4 Upgrade the pagination setup not working anymore](https://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore/)
 *  [jointplan](https://wordpress.org/support/users/jointplan/)
 * (@jointplan)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore/#post-2833782)
 * Additional to this is the $wp_query which is in blog.php that may help identify
   the issue rather than adding code to functions.php.
 *     ```
       $numwords = 100;
   
       $temp = $wp_query;
       $wp_query= null;
       $wp_query = new WP_Query();
       $wp_query->query('post_type=post&showposts=5'.'&paged='.$paged);
   
       $ct=0;
   
       while ($wp_query->have_posts()) : $wp_query->the_post();
   
       $ct++;
       	if($ct%2==1)
       		$bg="DAD5D5";
       	else
       		$bg="FFFFFF";
       	$strippedDesc = strip_tags(get_the_content());
       	preg_match("/([\S]+\s*){0,$numwords}/", $strippedDesc, $regs);
       	$shortDesc = trim($regs[0])." [...]";
       		if(trim($regs[0])=="")
       	{
       		$shortDesc = substr($strippedDesc,0,600)." [...]";
       	}
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [After WP 3.4 Upgrade the pagination setup not working anymore](https://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore/)
 *  [jointplan](https://wordpress.org/support/users/jointplan/)
 * (@jointplan)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore/#post-2833780)
 * Forgot to add that I thought it was just a /page/2/ issue but it turns out it’s
   the last page that causes the issue.
 * There are a few categories that stop at /page/3/ and cause the 404 as well as
   another that gets to something like /page/9/ before it produces a 404. (These
   show up on Google Webmaster Tools
 * An infinite loop problem but I’ve struggled to pinpoint the root cause.
 * For reference, this is the [blog URL](http://www.doylehance.com/mn-legal-blog/)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [After WP 3.4 Upgrade the pagination setup not working anymore](https://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore/)
 *  [jointplan](https://wordpress.org/support/users/jointplan/)
 * (@jointplan)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore/#post-2833779)
 * keesiemeijer,
 * I’ve had some success with the code but it has moved the issue slightly (and 
   thanks for the code by the way!)
 * **Original Symptoms as follow**
    1. Each Category archive would show the first
   page 2. Moving to /page/2/ on each Categories and it would produce a 404.
 * Originally I thought it was a WordPress issue since the website was upgraded 
   to WordPress 3.4 but after extensive analysis, it appears to be the theme.
 * **Implementing the Code**
    It helped in terms of getting past the issue of a 
   404 on /page/2/ (and thought it had cracked it to be honest) but the site now
   gets a 404 on any category URL that pass /page/3/
 * That is, /page/3/ is working but going to the “previous Page” or “Older Entries”
   produces a 404 on /page/4/
 * **This is the code that has helped the most**
 *     ```
       function my_post_queries( $query ) {
         if (!is_admin() && $query->is_main_query()){
           if(is_home() || is_category() || is_tag() || is_search() ){
       		$query->set('posts_per_page', 1);
           }
         }
       }
       add_action( 'pre_get_posts', 'my_post_queries' );
       ```
   
 * Any advise on the code would be a great help as I have tried near on everything
   in the WordPress Forum on this issue and various combinations thereof.
 * There are no plugins that play with the URL and I’ve also noticed that this applies
   to TAGS as well as CATEGORIES.
 * This is an [example of a category](https://wordpress.org/support/users/jointplan/replies/www.doylehance.com/category/family-law?output_format=md)
   that produced a 404 if you click on the “Older Entries” link and go beyond /page3/
 * Many Thanks and hope you’re able to assist.

Viewing 4 replies - 1 through 4 (of 4 total)