Dutch adres syntax
This topic contains 14 replies, has 6 voices, and was last updated by ict con 10 years, 3 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: dutch address
-
AuthorPosts
-
June 19, 2014 at 11:06 am #5021
Hello there,
When showing address at right sidebar it show like this:
Adres: [STREET]
[CITY]
[REGION]
[ZIPCODE]
[COUNTRY]I would change it to this:
Adres:
[STREET]
[ZIPCODE] [CITY]This is how in the Netherlands addressen are formated.
Please help.
June 19, 2014 at 11:52 am #5029Hi, mkblogic
Right now there is no quick solution for it but we will surely look into it and get back to you.June 19, 2014 at 11:54 am #5030If needed I can edit the php source?
June 19, 2014 at 12:40 pm #5037I would also like todo that! 1+ Can you tell us in which file this can be found?
Thanks!
June 19, 2014 at 12:40 pm #5038.
June 19, 2014 at 12:53 pm #5040Hi,
There is a filter available in the code plz use this code and put it in ur themes’ functions.php file
add_filter('geodir_show_post_address', 'geodir_change_address_order' , 100 , 2) ; function geodir_change_address_order($html , $vars) { global $post, $preview, $wpdb; $field_icon=''; if (strpos($field_icon,'http') !== false) {$field_icon_af = '';} elseif($field_icon==''){$field_icon_af = '<i class="fa fa-home"></i>';} else{$field_icon_af = $field_icon; $field_icon='';} if(!$preview) { $html = '<p class="" style="clear:both;" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">'; $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; $html .= ' '; $html .= '</span>'; //print_r($_POST); if($post->post_address){ $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>';} if($post->post_zip){ $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>';} if($post->post_city){ $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>';} if($post->post_region){ $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>';} if($post->post_country){ $html .= '<span itemprop="addressCountry">'.$post->post_country.'</span><br>';} $html .= '</p>'; } return $html ; }
June 19, 2014 at 1:56 pm #5053Many thanks. This works!!
June 20, 2014 at 5:54 pm #5312Vikas,
I tried placing this code in my child themes functions.php and it did not work… does this need to be placed in the parent theme file instead?
Sal
June 21, 2014 at 3:25 am #5357Hi Sal, I alerted Vikas, but as far as I know, it should be in the child theme’s functions.php.
Try never to touch the files of a theme or a plugin unless you really have to, all changes will be deleted when you upgrade your plugin.June 21, 2014 at 5:03 am #5372Hi,
I asked u to follow this post because this is similar to ur request. In this user asked to put zip code before the city name. So plz check i just simply put zip code parameter before city name. Now plz adjust all these variable as per ur format need, remove
where u dont need a new line or something.Please advise ?
December 5, 2014 at 10:33 am #23607Hello,
i have added it to the childtheme(avada) functions.php but it doesn’t seem to work. am i missing something ?
Regards,
December 5, 2014 at 11:48 am #23618@ict con
Yes, you need to adjust it to suit your requirements.
How does a Dutch address look like?December 6, 2014 at 9:27 am #23682The adres format looks like this:
[STREET]
[ZIPCODE] [CITY]
[COUNTRY]I would like to change the right bar a detail listing and make Region not a required field at the add listing post forms.
Regards,
December 6, 2014 at 10:33 am #23683Ok, below is the code you got to add to your child theme’s functions.php, and see here for an example: http://goldroo.net/attractions/attractions/guust/
add_filter('geodir_show_post_address', 'geodir_change_address_order' , 100 , 2) ; function geodir_change_address_order($html , $vars) { global $post, $preview, $wpdb; $field_icon=''; if (strpos($field_icon,'http') !== false) {$field_icon_af = '';} elseif($field_icon==''){$field_icon_af = '<i class="fa fa-home"></i>';} else{$field_icon_af = $field_icon; $field_icon='';} if(!$preview) { $html = '<p class="" style="clear:both;" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">'; $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; $html .= ' '; $html .= '</span>'; //print_r($_POST); if($post->post_address){ $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>';} if($post->post_zip){ $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span> ';} if($post->post_city){ $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>';} if($post->post_country){ $html .= '<span itemprop="addressCountry">'.$post->post_country.'</span><br>';} $html .= '</p>'; } return $html ; }
That removes the province from the address, but you will need that for the Add Listing form. You might be able to hide it with CSS but not that might give trouble if there are 2 towns with the same name in a different province.
This would hide it:#geodir_post_region_row {display: none;}
December 8, 2014 at 12:32 pm #23810Works like a charm 🙂
Thx !!
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket