[wp-trac] [WordPress Trac] #21790: When set a static front page WP main query isn't set correctly

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 5 16:00:06 UTC 2012


#21790: When set a static front page WP main query isn't set correctly
--------------------------+------------------------------
 Reporter:  markoheijnen  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  3.4.1
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------

Comment (by markoheijnen):

 I now solved the issue by using this:
 {{{
 ( $query->get('page_id') == get_option('page_on_front') || is_front_page()
 )
 }}}

 Reason was that is_front_page() doesn't work then in pre_get_posts(). It
 does work but I'm not a fan of using this.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21790#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list