Query for post and costom post_type in same category filtered by meta for post_type

I need to search post and custom post type which are both in the same category, but I need to filter only post type by a meta with a custom field.
Using meta_query I tried

$meta_query = array(array(
‘key’ => ‘public’,
‘value’ => ‘1’,
‘type’ => ‘NUMERIC’,
‘compare’ => ‘=’
)
);

but simple post doesn’t have this meta so they are excluded.
How can I refer this meta query only to custom post type and not to post?

Read more here:: Query for post and costom post_type in same category filtered by meta for post_type

Leave a Reply

Your email address will not be published. Required fields are marked *