#29587 closed defect (bug) (duplicate)
Duplicate content problem with URLs when using WP_Query in front-page.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 4.0 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
I have "Front page displays" set to "A static page".
"Front page" is set to a page I created via Pages > Add new.
"Posts page" is also set to a page I created via Pages > Add new.
The query I'm using in front-page.php is:
$args = array( 'post_type' => 'post', 'page' => $page ); $query = new WP_Query( $args );
If I visit example.com, I see the first page of my query results are displayed (as expected).
Problem:
When I visit a URL such as the following:
http://example.com/page/1/
I'd expect to be redirected to example.com.
http://example.com/page/2/
I'd expect to see the next page of results.
http://example.com/page2/
I'd expect to get a 404 error page.
http://example.com/page/29876987/
I'm not even sure what I should see here (I don't have that many posts).
But, in each case above, all that is shown is the first page of results. Nothing on the page changes.
I think this is a bug so am reporting. The title I've given this ticket is the best I could come up with (I was thinking for ages), please feel free to update it to something better.
Change History (4)
#2
@
10 years ago
- Severity changed from normal to major
- Summary changed from Problem with URLs when using WP_Query in front-page.php to Duplicate content problem with URLs when using WP_Query in front-page.php
I just spotted some related info in the Creating a Static Front Page article:
So I shouldn't have expected to see paged query results.
But, the duplicate content problem remains. For example:
example.com/page2/
example.com/page23/
example.com/page35/ ... and so on...
example.com/page/1/
example.com/page/2/ ... and so on..
...all result in the exact same content displayed as that on example.com.
Considering this affects the homepage, I think setting this ticket to major is appropriate? Please feel free to change back to normal if you feel differently.