Hi there,
we would like to display both posts and portfolio on a masonry grid – is that possible somehow?
Right now, we can only select between portfolio or normal categories.
Thanks in advance
Hey emilconsor,
Thank you for the inquiry.
Yes, this should be possible by adjusting the tax_query using the avia_masonry_entries_query filter. Example:
add_filter("avia_masonry_entries_query", function ($query) {
$query["tax_query"] = array(
'relation' => 'OR',
array(
'taxonomy' => 'portfolio_entries',
'field' => 'id',
'terms' =>
array(
0 => 8,
1 => 9,
2 => 10,
),
'operator' => 'IN',
),
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' =>
array(
0 => 2,
1 => 3,
2 => 1,
),
'operator' => 'IN',
),
);
return $query;
}, 10, 1);
Make sure to adjust the array of IDs and use the actual ID of the terms inside certain taxonomies (portfolio_entries, category).
array(
0 => 8,
1 => 9,
2 => 10,
),
Best regards,
Ismael
Hi Ismael,
thank you! That worked.