Excluding pages
-
Hi – wondering if there’s any way at all to exclude particular pages from the display? I didn’t have any luck using relevanssi or any of the other plugins mentioned, so tried doing this in the functions file, but the results are still showing the excluded pages (though it’s working when I just use the search function without this plugin) – is there anything else I can try?
`// search filter
function fb_search_filter($query) {if ( !$query->is_admin && $query->is_search) {
$query->set(‘post__not_in’, array(65, 696, 817) ); // id of page or post
}return $query;
}
add_filter( ‘pre_get_posts’, ‘fb_search_filter’ );`OR – does anyone know of a css style-able live search plugin like this that DOES work with excluding pages? I really want to use this one since it’s been such a breeze to set up, but we really need to hide our email signup confirmation pages from the search.
Thanks!
https://www.ads-software.com/extend/plugins/daves-wordpress-live-search/
- The topic ‘Excluding pages’ is closed to new replies.