You can use WP_Query
‘s tax_query
to do this. You would want the args (just on the tax_query
, I’ll leave the rest up to you, you have the documentation) to look something like this:
'tax_query' => array(
'relation' => 'OR'
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'wood'
),
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'kitchen'
)
),
That method will allow you to query as many types of posts as you like. Alternatively, you can have multiple WP_Query
s and use wp_get_post_categories()
to get the terms for a foreach
to feed dynamically generated suggestions, each with its own WP_Query
. It sorta depends how you want the output to look.