[wp-trac] [WordPress Trac] #29587: Problem with URLs when using WP_Query in front-page.php

WordPress Trac noreply at wordpress.org
Mon Sep 8 18:12:13 UTC 2014


#29587: Problem with URLs when using WP_Query in front-page.php
--------------------------+-----------------------------
 Reporter:  henry.wright  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29587>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list