I think your test is flawed.
It is the original query– the one you save to $temp
— that is important for working out which template loads. You overwrite that and paginate based on that overwritten query. That means that the pagination is out of sync with the original query. When you click a pagination link and then the page loads a query runs that does not have your modifications– 'showposts=2&post_type=recensione'.'&paged='.$paged
— and that query is used to work out the page to load. In some cases, probably many, the original query can’t make sense of the pagination based on the modified query and you get a 404.
I don’t know why “Custom Posts Per Page” solves it. I am not familiar with that plugin.
Related Posts:
- Custom permalink structure only for default posts
- Remove slashes (both before and after) in relative post url
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- Duplicate Custom Post Type and Taxonomy Slug
- How do I Redirect a WordPress Page?
- add_rewrite_rule and template redirect not working
- How to bulk Update URLs to new values?
- How to add a ‘News’ section to specific posts in WordPress
- Template for displaying CPT / Taxonomy URL issues
- Prevent Archive URLs
- Multipage Post URL correction
- Custom URL Structure for posts with subcategories
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- Rewrite a specific Post Format to URL slug
- Choose options via url
- Default post type doesn’t display in url
- Blog posts are not appearing as subs of Blog Page
- Automatically add date to the auto generation of post slug
- Permission issue with custom post type – not added to menu – by plugin
- How could I change my Permalink from blog to custom structure? [closed]
- Visting slug for ‘post’ post type shows 404 not archive?
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom
- WP Admin register taxonomy and post type performance
- Add a custom meta box in the post options that loads some html code in the header
- Static posts page with home.php
- Calling Different Custom Post Timestamps in a table
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Admin – create custom post status and display above table
- custom post template file not shown, instead all the time 404.php
- Set Default Category to Username
- How to allow visitors to filter posts by multiple taxonomies
- show custom post type category dropdown sorting result on same page
- Custom Post Type Rewrite To Include Parent Page(s)
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Retrieve post ID from “querying” URL
- Start post pagination at 0 instead of 1
- Thumbnail & Category link aside post
- Redirect to another page using contact form 7? [closed]
- How to include my own css in post
- Custom post types related to same custom post type?
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Dynamically switch template on click
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- Is it possible to customize the post according to post format in single.php?
- Customize rel=canonical tag for single blog post
- a little direction on custom post type
- disable Tab post on nav-menus page (Admin)
- Linking to pages/posts within the site
- WP move posts to different path
- Format latest/newest post differently
- Custom taxonomy archive page problem
- Tell WP to use a specific template file in posts
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- relating business and products with custom taxonomy?
- Best Way to Add UnEditable HTML to Posts
- How safe is it to delete old posts edits to save database space?
- Two Custom Post Types with Identical Articles Competing for the same Slug
- Custom Post Type archive
- WordPress custom post type with folder structure in slug
- Using setup_postdata() with multi-dimensional array
- Is codex right on deleting post?
- Check if a custom post type has already been created
- WordPress Query Posts From Category Post on Static Page
- Edit multiple custom post types while saving a new or edited post
- Make insterted image point to post url instead of attachment page
- Create a custom posts page
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- if in category but only with post meta
- How to get different Related Posts
- How to add convenient buttons for new custom post statuses
- How to allow multiple thumbnail upload for Posts?
- add external project to web site wordpress on production
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- $_GET parametters not working in an specific template
- Show custom post with custom categories with specific slug
- register_post_type permalink
- Display the 2nd category name of a custom post type without error if its null?
- Post is blank when I click on the link
- Auto delete posts based on content text
- How to call posts under a specific category on static front page?
- Querying another post category to match current post and display in loop
- Custom home page with full post for first one only
- How to get the latest URL of my blog?
- Custom Post Limit for homepage only without plugin?
- Display value of custom field at the beginning of a post
- Many Rewrite Parameters/Rules
- l accidentally permanently deleted a Draft. There’s any way I can recover it?
- datepicker value in mysql
- Inserting an example of the last 3 post on to the homepage
- Static pages not working
- Optimize CPT-function with a loop
- Post-Archive like a page in a specific subdirectory
- Add post tags to previously created custom post type
- Can WordPress handle following functionalities?
- Simple Custom Metabox Not Saving
- Get a term each custom post type
- Change default post style to columns
- Post titles and thumbnails as links to custom post types?