Hello all,
I’m trying to get my search page to display something like: “Displaying ## amount of results for places near X location, according to X, Y, Z (filters)”. I’ve been able to add the code which displays the total number of gd_places, but I wanted it to count only the results that resulted from the search. The URL of the page I’m talking about is ‘http://www.rateamdemo.com/?geodir_search=1&s=+&sgd_placecategory%5B%5D=&stype=gd_place&snear=&sgeodir_conference=&sgeodir_private_public%5B%5D=&sgeodir_division%5B%5D=&sgeo_lat=&sgeo_lon=’. I’ve added the following code:
//The function below displays the number of results showing on Listings Page
function display_number_results () {
$query_args = array(
‘post_type’ => ‘gd_place’,
);
//Line below establishes the text to be displayed
echo “Displaying “.geodir_get_widget_listings($query_args, true).” results:”;
}
//Line below adds the action before the list of places
add_action(‘geodir_before_listing_listview’,’display_number_results’);
Can someone help me with this?
Thank you very much!
Gui