WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 weeks ago

#39443 new defect (bug)

Search Page Template the_category() bug

Reported by: cybentizen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: Posts, Post Types Keywords: needs-screenshots dev-feedback
Focuses: Cc:
PR Number:

Description

Suppose If I've selected three categories following a structure HR -> Reports -> Daily Reports.

Single.php shows the structure in the right way but when I use the same the_category () function inside Search template then it shows the different result. Rather than showing it in the default structure, it shows it like Daily Reports -> HR -> Reports. In search template the structure changes to order by name. The_category working perfectly in other pages.

Change History (3)

#1 @bhargavbhandari90
3 years ago

  • Keywords needs-screenshots added

#2 @Howdy_McGee
3 weeks ago

  • Keywords dev-feedback added

Reverting back to 4.7 I don't see where it orders by hierarchy. It seems to order by Alpha always. In WordPress 4.9 there's the wp_get_object_terms_args filter hook which may circumvent this issue ( orderby parent ) but there isn't anything specific to the_category(). Not sure if this change is wanted or necessary. We would likely need an additional parameter to pass all the way down to wp_get_object_terms().

Last edited 3 weeks ago by Howdy_McGee (previous) (diff)

This ticket was mentioned in Slack in #core by howdy_mcgee. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.