Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › property bookings
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 11 months ago.
- AuthorPosts
- April 27, 2020 at 11:47 am #26917
Hi i am looking at searching for specific pages only i.e anything that comes after the url /book-accomodation/ is their a way to limit the search to only bring up these results? Also The property demo would be great if you can point me to where that is stored.
Damien
April 27, 2020 at 3:19 pm #26927Hi,
if the pages are categorized in any way, then you can use any of the inclusion/exclusion options.
Otherwise you can try using a custom code to exclude them via post-process. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
Best,add_filter( 'asp_results', 'asp_filter_posts_by_url', 10, 1 ); function asp_filter_posts_by_url( $results ) { foreach ($results as $k => &$r ) { if ( strpos($r->link, '/book-accomodation') === false ) unset($results[$k]); } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 27, 2020 at 3:40 pm #26930can i get a copy of the property demo?
i am also looking for some direction on how to exclude some pages as the above code didn’t work
Damien
-
This reply was modified 2 years, 11 months ago by
damiantos05.
April 28, 2020 at 10:10 am #26951Hi,
I cannot make copies of the demos, as it require the same exact installation, with the same exact post types, exporting that search will not work, as the underlying data would be missing.
In that demo we use taxonomy term as well as custom field filters. The search results shortcode is placed to a page builder element.To exclude pages, this will help.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
-
This reply was modified 2 years, 11 months ago by
- AuthorPosts
You must be logged in to reply to this topic.