Info tab not showing on free listings

This topic contains 13 replies, has 5 voices, and was last updated by  vicki 7 years, 2 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #346474

    vicki
    Buyer
    Post count: 76

    I have a free listing level that doesn’t allow an image or description, just address and phone. The detail page is showing Map and Review tabs but not an info tab with the address and phone.

    Here’s an example URL

    https://www.rawfoodsources.com/listings/us/iowa/ankeny/independent-pet-stores/wholesome-pet-essentials/

    The address shows properly on all other listing packages.

    I do have some code in functions.php to move data from sidebar (see below) but I don’t see that that would affect the info tab on this one package

    
    
    //* Code below removes listing info from right sidebar on Detail Page and puts in in Profile-Desc tab
    
    // add details in content area
    add_action('geodir_before_description_on_listing_detail','geodir_detail_page_more_info',10);
    
    // remove details from sidebar
    function my_change_sidebar_content_order() {
        return array( 
    							'geodir_social_sharing_buttons',
    							'geodir_share_this_button',
    							'geodir_edit_post_link',
    							'geodir_detail_page_review_rating',
    							'geodir_detail_page_google_analytics'
    							 );
    }
    add_filter('geodir_detail_page_sidebar_content', 'my_change_sidebar_content_order');
    
    //* Change formatting of address on listing detail page
    
    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='';}
    	
    	
    	{
    		$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:<span itemprop="streetAddress">'.$post->post_address.'</span><br>';}
    		if($post->post_city){ $html .= '<span itemprop="addressLocality">'.$post->post_city.',</span>&nbsp;';}
    		if($post->post_region){ $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span>&nbsp;&nbsp;';}
    		if($post->post_zip){ $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>';}
    		if($post->post_country){ $html .= '<span itemprop="addressCountry">'.$post->post_country.'</span><br>';}
    		$html .= '</p>';
    	}
    	return $html ;
    }
    
    
    #346629

    Guust
    Moderator
    Post count: 29970

    Have you tried disabling that code to see if the info comes back?

    #346630

    Paolo
    Site Admin
    Post count: 31206

    Please also provide admin credentials in case that doesn’t work…

    Thanks

    #346831

    vicki
    Buyer
    Post count: 76

    I did, and of course if I remove the code moving info from the sidebar it DOES appear in the sidebar, but that’s not really the issue. The issue is that the address appears in the Info/Profile tab for all other packages except “Bare Bones” id=1. I couldn’t find any field setting for that package that would hide the address information. I looked at the code in functions.php, which I took from here:

    https://wpgeodirectory.com/support/topic/detail-listing-info-inside-profile-tab/

    and there doesn’t seem to be anything there that would affect package type, so I’m stumped. I’ll send admin details in a private msg if you need to log in.

    #346865

    vicki
    Buyer
    Post count: 76
    This reply has been marked as private.
    #347021

    Paolo
    Site Admin
    Post count: 31206

    I asked to the developers to have a look. They’ll let you know after the week end.

    Thanks

    #347034

    vicki
    Buyer
    Post count: 76

    Thank you!

    #347789

    Giri
    Expired Member
    Post count: 3155

    Hi Vicki,

    Info/Profile tab will be visible only when you have some description.

    Please fill some text, empty your wpengine cache and then try.

    #347980

    vicki
    Buyer
    Post count: 76

    OK. I didn’t see that anywhere in the documentation. That leads to a couple more questions.

    1. If I limit the description for a package to, say, 100 characters, but the description field contains 250 char of text, is there any way to add an ellipsis or some indication that the text isn’t complete? This is especially helpful if a listing downgrades on expiration. Text cut off mid sentence looks weird.

    2. From my testing it looks like if I set a description limit greater than 0, the address will display in the profile tab even if the description field is empty. Is that the expected behavior?

    I need to rethink the free package and this new information will help me figure out which way to go. My thinking was that disallowing a description on free listings would avoid instances where someone typed in their URL rather than upgrade to have a link in a paid package.

    I’ve added code to prevent html tags in the description, but that doesn’t stop people from typing the URL. But I *did* want the address and phone to display.

    #347982

    Giri
    Expired Member
    Post count: 3155

    OK. I didn’t see that anywhere in the documentation. That leads to a couple more questions.

    Don’t you think thats obvious? If the tab content is empty, it doesn’t make sense to show the tab.

    In your case, you have customised your site’s profile tab. You are using a hook to add your custom fields above the profile tab content.

    1. If I limit the description for a package to, say, 100 characters, but the description field contains 250 char of text, is there any way to add an ellipsis or some indication that the text isn’t complete? This is especially helpful if a listing downgrades on expiration. Text cut off mid sentence looks weird.

    I think that might be possible with css.

    2. From my testing it looks like if I set a description limit greater than 0, the address will display in the profile tab even if the description field is empty. Is that the expected behavior?

    We check for empty string, before displaying profile tab. Even if you place a dot in description that tab will get displayed. So yes its expected behaviour.

    Edit: @paolo, can you answer his second point? I think I misunderstood his 2nd point.

    Thanks

    #348145

    Paolo
    Site Admin
    Post count: 31206

    I’m not 100% sure, but I believe the profile tab is only hidden if the description limit is 0.

    If the limit isn’t 0 it will be displayed even if it’s empty, but that’s not possible if added from the front end because it’s a mandatory field, so only the admin could create a empty listing from the back end.

    I asked to Stiofan to let us know if this is correct or not.

    Thanks

    #348147

    vicki
    Buyer
    Post count: 76

    Thanks, I’ve been looking into this more. It does seem that changing the description limit made the tab display even if it’s empty. Good reminder about that only being available from the back end.

    I looked into the CSS but there aren’t any solutions that would apply to the description on just one package type, so I’ll look for other ways to handle this now that I understand better how it works.

    #348472

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    If you set the description limit to “0” then the description input field on freontend and tab will be hidden/removed, this feature was added by request of many users who wanted to sell a description as a upgrade.

    Stiofan

    #348706

    vicki
    Buyer
    Post count: 76

    Yes, Stiofan, I understand now. What was throwing me off is that I had added code to make the info details display in the profile tab rather than the sidebar and forgot that was not default behavior. I, too, wanted to set the description limit to 0 for free listings as an incentive to upgrade. So I may go back to info details in the sidebar, although I think more people see them in the tabs due to “banner blindness”.

    In any case, thanks for the clarification and please tell Kiran “I love u too” for the title code here

    https://wpgeodirectory.com/support/topic/cant-find-listing-title-listing-description-in-the-po-file/page/2/

    since I’ll use that if I keep the details in the sidebar.

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

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

Open Support Ticket