[wp-trac] [WordPress Trac] #24473: is_home returns true for pages created with custom rewrite_rules

WordPress Trac noreply at wordpress.org
Fri May 31 19:10:20 UTC 2013


#24473: is_home returns true for pages created with custom rewrite_rules
---------------------------+-----------------------------
 Reporter:  LucasMS        |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Rewrite Rules  |    Version:  3.5.1
 Severity:  normal         |   Keywords:
---------------------------+-----------------------------
 I have a plugin for question and answers, where the questions index and
 question pages are created using add_rewrte_rule . (I know I could do
 something similar using custom post types, but this plugin was done long
 before this feature).

 here are my rewrites called in init hook:


 {{{
 add_rewrite_rule('^questions/([^/]+)/?',
 'index.php?questions_category=$matches[1]', 'top');
 add_rewrite_tag('%questions_category%', '([^&]+)');
 }}}

 The problem is, in the header of the template I use is_home() to load some
 custom codes, but is_home() is returning true in theses question pages.

 Tthese pages are not of any wordpress type (post, page, 404, home,
 archives - tax, dates, categories and so on). My suggestion is to create a
 new is_dynamic boolean variable for this kind of pages.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24473>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list