- This topic has 5 replies, 3 voices, and was last updated 5 years, 8 months ago by
Hunter Koerner.
-
AuthorPosts
-
October 3, 2016 at 11:33 pm #54570
Alan Green
MemberIs there any way to change this
<?php gmw_results_message( $gmw, false ); ?>
from “Showing 30 out of 300 results” to something else i.e. 30 of 300 businesses”
Thanks.
October 4, 2016 at 10:07 pm #54657Eyal Fitoussi
MemberHi Alan,
This should work:
1234567function gmw_modify_results_message( $labels ) {$labels['search_results']['pt_results_message']['showing'] = 'Showing %s out of %s businesses';return $labels;}add_filter( 'gmw_set_labels', 'gmw_modify_results_message', 50 );I hope that helps.
October 4, 2016 at 10:27 pm #54662Alan Green
MemberHi.
That’s great but on entry to the page it still shows the existing text. It’s only when I then perform a search that this new text appears. Also, when it does come up it says “Showing 30 of 347 businesses within 200 mi from mylocation”
Can I change “mi” to “miles”
On a slightly different note is there any way to change the distance dropdown? It currently says
Miles
5
10 etcWhereas it’d love it to say:
Distance
5 miles
10 miles
etcThanks.
October 5, 2016 at 8:47 pm #54676Eyal Fitoussi
MemberThat’s great but on entry to the page it still shows the existing text. It’s only when I then perform a search that this new text appears.
I just tested the search page of your site and the text seems to be working fine both on page entry and on form submission. Unless I am looking at the wrong search page?
Also, when it does come up it says “Showing 30 of 347 businesses within 200 mi from mylocation”
Can I change “mi” to “miles”Yes. Change the first function I provided you with with the function below:
12345678function gmw_modify_results_message( $args ) {$args['message']['showing'] = 'Showing %s out of %s businesses';$args['units'] = 'miles';return $args;}add_filter( 'gmw_results_message_args', 'gmw_modify_results_message', 50 );On a slightly different note is there any way to change the distance dropdown?
That’s, unfortunately, won’t be very easy to tweak. It is possible, but will require you to rebuilt the radius dropdown function and place it in the search form template file.
I will look into adding an easier solution for this in a future update of the plugin.
Let me know if the above helps.
October 5, 2016 at 10:41 pm #54678Alan Green
MemberThanks for this. All works perfectly now.
October 10, 2016 at 2:05 am #54865Hunter Koerner
MemberJust to +1, I would also love a way to change the distance dropdown. Ideally, I’d have the list look something like this:
• Within 5 miles
• Within 10 miles
• Within 30 miles
• Within 60 milesAnd have the ability to have it default to one of the selections.
-
AuthorPosts
You must be logged in to reply to this topic.