There are two posts Post121 and Post122 , which Test1 into the category Test1 subcategory Test12
There is a wp_post table:
ID | post_title | post_name | 157 | Post121 | post121 | 159 | Post122 | post122 | Table wp_term_relationships :
object_id | term_taxonomy_id | 1 | 1 | 157 | 4 | 159 | 4 | Table wp_term_taxonomy :
term_taxonomy_id | term_id | 2 | 2 | 3 | 3 | 4 | 4 | 5 | 5 | wp_terms table:
term_id | name | 2 | Test1 | 3 | Test11 | 4 | Test12 | you need to make a sample to get it:
PostTitle | CategoryTitle | Post121 | Test12 | Post122 | Test12 |
wp_posts.post_title,wp_terms.nameFROMwp_postsINNER JOINwp_term_relationshipsONwp_posts.ID=wp_term_relationships.object_idINNER JOINwp_term_taxonomyONwp_term_relationships.term_taxonomy_id=wp_term_taxonomy.term_taxonomy_idINNER JOINwp_termsONwp_term_taxonomy.term_id=wp_terms.term_id- Vasil Tkachuk