[wp-trac] [WordPress Trac] #42164: Conditional Tags not working when using ugly URL

WordPress Trac noreply at wordpress.org
Tue Oct 10 10:23:16 UTC 2017


#42164: Conditional Tags not working when using ugly URL
---------------------------+-----------------------------
 Reporter:  petersplugins  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Query          |    Version:  4.8.2
 Severity:  normal         |   Keywords:
  Focuses:  template       |
---------------------------+-----------------------------
 When accessing a category archive via its pretty URL e.g.
 {{{
 example.com/category/whatever
 }}}
 the conditional tag
 {{{
 is_category()
 }}}
 returns '''true'''.

 Accessing the same category archive via its ugly URL
 {{{
 example.com?cat=whatever
 }}}
 the conditional tag
 {{{
 is_category()
 }}}
 returns '''false'''.

 I'm pretty sure this concerns other conditional tags too. This is not only
 a cosmetic flaw because it causes WP to use the wrong template. I've
 tested it with Twenty Seventeen and the homepage template was used in case
 of using an ugly URL.

 Due tue the ugly URL always work independently of permalink settings this
 is a bug in my opinion.

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


More information about the wp-trac mailing list