Thank you very much ChrisB
I checked the solution and it worked, but it has at least two problems!
The first and the more important is that, using this CSS-based solution leaves a whole blank space between the visible Ads, which is not visually perfect at all!
We need a solution similar to the previous ihor’s solution (@ihor) which basically puts the desired listings out of the search results, but as I mentioned above, that code makes the listing’s link inaccessible and invisible to the public too!
add_action(
'pre_get_posts',
function( $query ) {
if ( is_admin() || ( ! $query->is_main_query() && ! $query->get( 'hp_main' ) ) ) {
return;
}
$query->set( 'post__not_in', [ 1, 2, 3 ] );
},
1000
);
Any other idea?