[wp-trac] [WordPress Trac] #55426: Two Categories in one URL; Shows Posts that are in BOTH Categories doesn’t work

WordPress Trac noreply at wordpress.org
Mon May 16 00:11:42 UTC 2022


#55426: Two Categories in one URL; Shows Posts that are in BOTH Categories doesn’t
work
-----------------------------------------+------------------------------
 Reporter:  gooloode                     |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Taxonomy                     |     Version:  5.9.3
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+------------------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch => has-patch reporter-feedback
 * severity:  critical => normal


Comment:

 Are you able to try reproducing this on a fresh WordPress install running
 the Twenty Twenty-Two theme without any plugins?

 I am unable to reproduce this on a vanilla WordPress install, ie one using
 a default theme without any plugins.

 Visiting `http://wp-dev.local/category/categorized+uncategorized/` on my
 development environment only shows the two posts in both categories. The
 SQL query produced is

 {{{#!sql
 SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
 FROM wp_posts
 LEFT JOIN wp_term_relationships
 ON (wp_posts.ID = wp_term_relationships.object_id)
 LEFT JOIN wp_term_relationships AS tt1
 ON (wp_posts.ID = tt1.object_id)
 WHERE 1=1
 AND ( wp_term_relationships.term_taxonomy_id IN (5)
 AND tt1.term_taxonomy_id IN (1) )
 AND ((wp_posts.post_type = 'post'
 AND (wp_posts.post_status = 'publish')))
 GROUP BY wp_posts.ID
 ORDER BY wp_posts.post_date DESC
 LIMIT 0, 10
 }}}

 I've tested this on both WordPress 5.9 and soon to be released WordPress
 6.0. It uses a similar DB query but you can see and example of displaying
 [https://make.wordpress.org/core/tag/dev-notes+6.0/ two tags: dev and 6.0]
 on the make/core blog.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55426#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list