City, Country on Listings in Supreme

This topic contains 11 replies, has 3 voices, and was last updated by  Paolo 8 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #199307

    Gavin Peacock
    Expired Member
    Post count: 9

    Hi,

    A couple of points if you could help. I’m using the supreme theme if that makes a difference for these questions.

    1) Could you please tell me how to add the city and country fields on to the listing tiles of a Listings page. I’ve tried selecting the address field to display on listings, but this shows the entire address. I don’t see an option of only adding city/region/country which would look cleaner.

    2) I’m using the new option in Supreme to list out the sections on the detail page instead of having them in Tabs. How can they be re-ordered? The new fields I add are way under the reviews at the very bottom of the page. As a minimum i’d like to re-order, if at all possible it would be great to have a mixture with some sections in a tab layout, and the others above outside of tabs.

    I found an article regarding re-ordering tabs, but i don’t know if this applies since the ‘display as list’ option was introduced.

    Thanks,

    #199446

    Guust
    Moderator
    Post count: 29970

    1) Add the whole address like you did, and then hide the address with CSS. Something like

    .post-type-archive span[itemprop="streetAddress"] {display: none;}

    should do it.

    2) Have a look here: https://wpgeodirectory.com/re-order-tabs-in-a-listing-detail-page/
    That should still apply.

    To have a mixture with some sections in a tab layout, and the others above outside of tabs, would require customization.

    #199830

    Gavin Peacock
    Expired Member
    Post count: 9

    Thanks Guust,

    Regarding the first answer. I’ve tried this, but because of the

    <br>

    tags that are in there, the final formatting of the location is pretty awful looking. I was hoping i could have city, country. Could you direct my to the function or file that inserts this into the listing details blocks?

    I’ll check out the article regarding the ordering of the sections. In the future, it would be nice if it was possible to have a mixture of the two tabs and main body content.

    Cheers,

    #199864

    Guust
    Moderator
    Post count: 29970

    1. You can add this to your functions.php file, that should return something like in the image:

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

    2. I have asked Paolo to look at your other question.

    #199867

    Gavin Peacock
    Expired Member
    Post count: 9

    Thanks Guust,

    The new function you’ve just provided works great. Exactly what i needed. I am not able to get the tab re-ordering function to work however based on instructions on the page you linked to. I’ll wait for your feedback from Paolo.

    Best,

    #200439

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    the re-order function provided as example will work no matter if you are displaying the content as tabs or as list.

    If you provide a link and admin credentials we will have a look at what you have done so far.

    Let us know,

    Thanks

    #200574

    Gavin Peacock
    Expired Member
    Post count: 9
    This reply has been marked as private.
    #201104

    Paolo
    Site Admin
    Post count: 31206

    Hi Gavin,

    I’m getting: Invalid Username/Password.

    Can you please double check them?

    Let us know,

    Thanks

    #201145

    Gavin Peacock
    Expired Member
    Post count: 9
    This reply has been marked as private.
    #201864

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    some of your tabs are excluded in GeoDirectory >> Design >> Datails. In Supreme theme that moves them to the sidebar.

    If you include the tabs back, it should be working correctly.

    Let us know,

    Thanks

    #202069

    Gavin Peacock
    Expired Member
    Post count: 9
    This reply has been marked as private.
    #202519

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    it looks like you missed a part of the tutorial.

    Start with:

    If you are using fieldsets in tabs, the tab index is assigned automatically and unfortunately it isn’t that obvious to figure out.

    https://wpgeodirectory.com/re-order-tabs-in-a-listing-detail-page/

    Please follow that part and you should be able to easily reorder the custom tabs within the array too.

    Let us know how you went,

    Thanks

Viewing 12 posts - 1 through 12 (of 12 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount