I didn’t change anything, there was no such code in there, I just added it exactly as provided by the other member…
// Formatting address in GD sidebar
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 .= 'Address:<br><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_region){ $html .= '<span itemprop="addressRegion">'.$post->post_region.', </span> ';}
if($post->post_country){ $html .= '<span itemprop="addressCountry">'.$post->post_country.'</span><br>';}
$html .= '</p>';
}
return $html ;
Thanks