Location Address Display

This topic contains 22 replies, has 8 voices, and was last updated by  ssalustri 8 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #114194

    mb
    Buyer
    Post count: 151

    Thanks for sharing!

    #114465

    ssalustri
    Expired Member
    Post count: 86

    Hi guys,
    i tried to use the code in my functions.php file (gd framework child theme) but address layout not change. Here’is an example http://test.turismoumbria.net/eventi/narni/festival/nosv-not-official-san-valentino/.

    Where i’m wrong?

    Stefano

    #114627

    Paolo
    Site Admin
    Post count: 31206

    We need to chech the added code… we can’t tell by looking at the website.
    Thx

    #115777

    ssalustri
    Expired Member
    Post count: 86
    This reply has been marked as private.
    #115815

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    the code was not present in your active theme functions.php file. I’ve added it exactly as provided by @chrisat15 and it worked.

    Thanks

    #115829

    ssalustri
    Expired Member
    Post count: 86

    Hi Paolo,
    code in my theme’s functions.phpt (/test/wp-content/themes/GeoDirectory_framework_child/functions.php) is commented. What code did you change?

    Stefano

    #115830

    Paolo
    Site Admin
    Post count: 31206

    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 .=  '&nbsp;';
    		$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>&nbsp;';}
    		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>&nbsp;';}
    		if($post->post_country){ $html .= '<span itemprop="addressCountry">'.$post->post_country.'</span><br>';}
    		$html .= '</p>';
    	}
    	return $html ;

    Thanks

    #115833

    ssalustri
    Expired Member
    Post count: 86

    Sorry Paolo,
    commented code it was previously entered by me. Now works.

    Thanks

    Stefano

Viewing 8 posts - 16 through 23 (of 23 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket