Extra Tab on Details Page

This topic contains 5 replies, has 2 voices, and was last updated by  Simone 9 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #37674

    Sara Graybill
    Buyer
    Post count: 18

    I’ve created an extra tab on the details page for my product_providers CPT. I’ve used the following code to add it:

    
    
    //Directory Details Page
    add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend') ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
     	$tab_array['company-information'] = array( 
    		'heading_text' =>  __('Company Information',GEODIRECTORY_TEXTDOMAIN),
    		'is_active_tab' => false,
    		'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true, 'company-information'),
    		'tab_content' => ''
    		);
    	return $tab_array ;
    }
    
    add_action('geodir_after_tab_content' ,'geodir_my_new_tab_content');
    function geodir_my_new_tab_content($tab_index)
    {
    	global $post; 
    
    	if($tab_index =='company-information')
    	{
    		global $wpdb;
            	$id = get_the_ID();
            	$companydescription = $wpdb->get_var("SELECT geodir_products_companyname FROM geodir_gd_product_providers_detail WHERE post_id = $id ");
    
         		echo $companydescription;    
    	}
    }

    The tab shows up fine and when I add straight text it works. It doesn’t when I’ve tried to add the custom field products_companyname. I was just wondering if you all knew what was wrong.

    #37677

    Simone
    Expired Member
    Post count: 3515

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #37699

    Sara Graybill
    Buyer
    Post count: 18

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #37702

    Sara Graybill
    Buyer
    Post count: 18
    This reply has been marked as private.
    #37738

    Simone
    Expired Member
    Post count: 3515

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #37739

    Simone
    Expired Member
    Post count: 3515
    This reply has been marked as private.
Viewing 6 posts - 1 through 6 (of 6 total)

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

Open Support Ticket