As explained here Post List components queries can be customized using the wpak_posts_list_query_args filter hook.
Here’s how to define a component (slug my-component-slug) that gets posts from 2 categories (my-first-category-slug and my-second-category-slug) instead of only one.
Create a post list component in your app, associated to one category. Then use the tax_query parameter of WP_Query to customize the component’s categories and add a second category it:
//To put in the "php" folder of your WP-AppKit theme:
function two_categories_for_my_component( $query_args, $component ) {
if( $component->slug === 'my-component-slug' ) {
$query_args['tax_query'] = array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'my-first-category-slug'
),
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'my-second-category-slug'
)
);
}
return $query_args;
}
add_filter( 'wpak_posts_list_query_args', 'two_categories_for_my_component', 10, 2 );