City, Country on Listings in Supreme
This topic contains 11 replies, has 3 voices, and was last updated by Paolo 8 years, 6 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
May 27, 2016 at 8:14 pm #199307
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,
May 28, 2016 at 1:54 am #1994461) 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.
May 29, 2016 at 11:06 am #199830Thanks 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,
May 29, 2016 at 12:54 pm #1998641. 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 .= ' '; $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.
May 29, 2016 at 1:35 pm #199867Thanks 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,
May 30, 2016 at 3:54 pm #200439Hi,
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
May 30, 2016 at 9:05 pm #200574This reply has been marked as private.May 31, 2016 at 6:25 pm #201104Hi Gavin,
I’m getting: Invalid Username/Password.
Can you please double check them?
Let us know,
Thanks
May 31, 2016 at 6:59 pm #201145This reply has been marked as private.June 1, 2016 at 3:10 pm #201864Hi,
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
June 1, 2016 at 10:11 pm #202069This reply has been marked as private.June 2, 2016 at 9:45 pm #202519Hi,
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
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket