Search and matches

This topic contains 4 replies, has 3 voices, and was last updated by  Kiran 5 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #522657

    Manfred Van Ursel
    Expired Member
    Post count: 295

    Hi friends,

    We have two Search related questions.

    1) Show how accurate is a search result

    When users search on our directory we’d like to show a “percentage” of “how accurate” the search resuts are.

    Something like “this search result item is a 90% match”.

    Is there a way to accomplish this you can point us to?

    2) “Your search found XXX results” text.

    How can we print a message like so in the Search Results page? “Your search found XXX results”.

    Thanks,

    #522667

    Alex Rollin
    Moderator
    Post count: 27815

    I will ask the developers to take a look at your question, probably after the weekend.

    #522834

    Kiran
    Moderator
    Post count: 7069

    Hello Manfred,

    1) It is not possible at the moment.
    2) Go to GeoDirectory > Settings > Pages > Edit “Search Page”
    In page content modify shortcode “gd_loop_paging” & add “show_advanced” attribute to show advanced pagination results.
    Example:

    [gd_loop_paging show_advanced='after']

    Regards,
    Kiran

    #523018

    Manfred Van Ursel
    Expired Member
    Post count: 295
    This reply has been marked as private.
    #523038

    Kiran
    Moderator
    Post count: 7069

    Hello,

    You have only one results so pagination not showing on the page. It shows pagination when there are multiple pages to show, but right now you have only one page.

    You can display message by adding following PHP snippet. Check here about how to use PHP snippet. https://wpgeodirectory.com/docs-v2/faq/customizing/#snippets

    
    
    function gd_snippet_191226_show_search_results() {
    	global $wp_query, $geodir_is_widget_listing;
    
    	if ( ! $geodir_is_widget_listing && geodir_is_page( 'search' ) && ! empty( $wp_query ) && ! empty( $wp_query->found_posts ) && GeoDir_Query::is_gd_main_query( $wp_query ) ) {
    		echo '<div class="_geodir-search-results" style="padding:10px 0"><span>';
    		echo wp_sprintf( __( 'Your search found <b>%d</b> results' ), $wp_query->found_posts );
    		echo '</span></div>';
    	}
    }
    add_action( 'geodir_before_listing_listview', 'gd_snippet_191226_show_search_results' ); // Show before listings
    add_action( 'geodir_after_listing_listview', 'gd_snippet_191226_show_search_results' ); // Show after listings

    Regards,
    Kiran

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount