property bookings

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 12 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26917
    damiantos05
    damiantos05
    Participant

    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

    #26927
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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!

    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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26930
    damiantos05
    damiantos05
    Participant

    can 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 3 years, 12 months ago by damiantos05 damiantos05.
    #26951
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.