Hi there,
I am trying to hide the specific listing type “Event” preview cards.
Because of stupid basic ML behavior I currently need to have a “Global listing type “called “ALL” to show all listing preview cards.
How can I hide the preview cards with the listing type “event”? E.g. with CSS or sth. because currently when I use “display:none” a blank space of the height of the preview cards are still shown.
See picture: https://ibb.co/fGsN8sn
I refer you to the snippet from the mylisting helpdesk: https://helpdesk.27collective.net/questions/question/exclude-one-listing-type-from-global-search/
add_filter(
'mylisting/get-listings/before-query'
,
function
( &
$args
,
$type
) {
if
(
$type
->is_global() ) {
$args
[
'meta_query'
][
'listing_type_query'
] = [
'key'
=>
'_case27_listing_type'
,
'value'
=>
'YOUR-EXCLUDED-LISTING-TYPE-SLUG'
,
'compare'
=>
'NOT IN'
,
];
}
return
$args
;
}, 150, 2 );