Opened 15 years ago
Closed 15 years ago
#12906 closed defect (bug) (invalid)
paged broken with post_type set?
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Query | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
querying a list of posts using index.php?post_type=post, pagination does not work. If paged is set, the view is marked as being "is_404".
To reproduce, go to index.php?post_type=post&paged=2
Change History (11)
#3
@
15 years ago
- Keywords reporter-feedback added
Have you tried disabling all plugins and switching to the default theme?
#4
@
15 years ago
Yes. All plugins deactivated, standard theme, no custom post types created through functions.php or anything. www.exampleblog.com/?post_type=post&paged=2 results in a 404.
My current WP revision is r14032
#5
@
15 years ago
Researched a little further. When i do www.exampleblog.com/?post_type=post, the queryvar "p", and "page_id" is set to "1". The page with id 1 is the page i defined for being my blog static home page.
That id is defined on line 1489 of query.php:
$qv['page_id'] = get_option('page_on_front');
By commenting this, paging works again. So the bug is somehow related to WP thinking that ?post_type=post == is_home()?
#7
@
15 years ago
Yes, home is a static page.
doing just ?paged=2 doesn't make any visual changes, since the page is static, but if i output the $wp_query i see that 'is_paged" is '1'.
'is_paged' is unset in the other case.
#8
@
15 years ago
Having home set to a static page and then going to ?post_type=post&paged=2
doesn't really make sense.
Maybe if you had a (public) custom post type instead of 'post'.
#9
@
15 years ago
I have 5 additional custom post types, and would like to present them differently. So actually the query in my case looks like ?post_type=review&paged=2
By adding custom post types to WP, you should expect you were able to list them as well.
#10
@
15 years ago
You will be able to list them, just not on a static page (Unless that page has a loop in it).
You'll need to use /page-for-blog-posts/?post_type=review instead.
Your best bet, is to make a /review/ page, add a custom template with a proper loop in it.
I'm tempted to close this as invalid myself, due to the above comments and the fact its a static page.
Can't reproduce using r14040.