adding detail tabs

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

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #381120

    mrv
    Expired Member
    Post count: 54

    Could you provide me some additional code that would allow adding 3 tabs on the detail page and an example of how a shortcode should be entered based on the information shown here… https://wpgeodirectory.com/add-a-new-tab-in-the-listing-detail-page/

    Thanks!

    #381129

    Kor
    Moderator
    Post count: 16516

    Hi mrv,

    Check out the code below and test it out.

    
    
    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['my_new_tab'] = array( 
    'heading_text' =>  __('New Tab',GEODIRECTORY_TEXTDOMAIN),
    'is_active_tab' => false,
    'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true,'my_new_tab'),
    'tab_content' => '');   
    $tab_array['my_new_tab2'] = array( 
    'heading_text' =>  __('New Tab2',GEODIRECTORY_TEXTDOMAIN),
    'is_active_tab' => false,
    'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true,'my_new_tab2'),
    'tab_content' => '');   
    $tab_array['my_new_tab3'] = array( 
    'heading_text' =>  __('New Tab3',GEODIRECTORY_TEXTDOMAIN),
    'is_active_tab' => false,
    'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true,'my_new_tab3'),
    'tab_content' => ''); 
    return $tab_array ; } 
    #381131

    mrv
    Expired Member
    Post count: 54

    The code works… thank you!

    How to add a shortcode to the tabs?

    #381155

    Kor
    Moderator
    Post count: 16516

    Hi mrv,

    Try this and see if it works.

    
    
    add_action('geodir_after_tab_content' ,'geodir_my_new_tab_content');
    function geodir_my_new_tab_content($tab_index)
    {
    if($tab_index =='my_new_tab')
    {echo do_shortcode('[MY-SHORTCODE]');}
    }
    #381174

    mrv
    Expired Member
    Post count: 54

    I can get the first shortcode to work in my_new_tab. Now how to get a different shortcode to work in my_new_tab2? I’m not sure of the add_action change needed. I am using gd_listings shortcode with different parameters for each tab.

    The listings in my_new_tab need one more parameter… post_id. How to show only listings related to detail page that is open?

    Can these newly created tabs be hidden until they have listings to show in them?

    Thanks!!!

    #381188

    Paolo
    Site Admin
    Post count: 31206

    Hi Mrv,

    this is considered a customization and it’s beyond support. Kor already provided more than he’s supposed to be providing in terms of pointers…

    If you need someone to write the code for you following your instruction, you’ll need to hire a freelance developer on websites like codeable.io or upwork.com

    Thanks

    #381199

    mrv
    Expired Member
    Post count: 54

    🙁

    #381215

    Paolo
    Site Admin
    Post count: 31206

    I don’t understand the sad face, are you expecting free customization work from us?

    Please read support policy that you agreed to: the https://wpgeodirectory.com/support-policy/

    Thanks

    #381259

    mrv
    Expired Member
    Post count: 54

    I’ve gone outside for custom work and it’s been very disappointing. Twice I have paid for customizing and both times they failed to complete the request. So yes I am a little sad to hear I have to go back to something that hasn’t worked. I’d rather pay you for the work that is getting done right! Greatly appreciate any help you do provide!

Viewing 9 posts - 1 through 9 (of 9 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