Forum Replies Created
-
AuthorPosts
-
jpequens
MemberThanks! I did not have <?php global $post; ?>
jpequens
MemberYes, it is in the results template and not populating anything.
Search a location on this page if you would like to see it: Floattanks.net
I have it to the left of the map and hours link on each result.
jpequens
MemberHello –
I had the above code on this thread working to filter out search results on pages like this:
This way it would load only locations nearby Orlando FL (I was passing in the city with a custom field).
It looks like that filter no longer works with the update. Any suggestions on where to make the adjustment? Is this now a premium feature?
Any direction would be helpful.
Thanks!
jpequens
MemberFinally got it to work. Here is what it is if anybody needs it. ‘city_address’ is the custom filed I am using so change that as needed. I also have this for Form ID 5. Just add the below to the functions.php file and change your form id or custom field as needed.
123456789function gmw_formload( $gmw ) {if ( $gmw['ID'] == 5) {$gmw['page_load_results']['address_filter'] = get_field('city_address');}return $gmw;}add_filter( 'gmw_pt_default_form_values' , 'gmw_formload', 99 );jpequens
MemberI’ve tried following the information from this page and still not having any luck:
https://wordpress.org/support/topic/possible-to-set-the-default-starting-address-on-the-fly
add_filters is something I’ve not done much with before, so I’m not sure If I need to do anything special
I’ve added this to my functions.php file (I’m using form id=5 and a advance custom field ‘city_address’)
function gmw_formload( $gmw ) {
$city_cord = the_field(‘city_address’);
if ( $gmw[‘ID’] == 5) {
$gmw[‘page_load_results’][‘address_filter’] = $city_cord;
}return $gmw;
}
add_filter( ‘gmw_pt_default_form_values’ , ‘gmw_formload’, 99 );Feel like I am close…any help would be very much appreciated
-
AuthorPosts