I added a new tab. Now to organize…

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

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

Open Support Ticket
  • Author
    Posts
  • #30159

    merchbroker
    Expired Member
    Post count: 32

    Hello ,

    I added a new Tab per your instructions and now I went to reorganize according to your instructions. This obviously didn’t work because I need to account for the new tab. Can you guide me on this?

    Thanks!

    #30169

    Guust
    Moderator
    Post count: 29970

    How did you add the new tab?
    Are these the instructions you followed?
    WP admin details please if you want us to have a check.

    #30185

    merchbroker
    Expired Member
    Post count: 32
    This reply has been marked as private.
    #30216

    Paolo
    Site Admin
    Post count: 31206
    #30240

    merchbroker
    Expired Member
    Post count: 32

    Yes,
    I think it didn’t work because I added a custom tab. I researched a lot.

    #30245

    Paolo
    Site Admin
    Post count: 31206

    Can you please paste your function here? Thx

    p.s. and FYI : this is a customization, we provide tutorials to make similar changes, but we don’t debug your custom code on your behalf as part of support here. If you want to modify how the plugin works, you are supposed to know how to debug a function.

    #30251

    merchbroker
    Expired Member
    Post count: 32
    This reply has been marked as private.
    #30252

    Paolo
    Site Admin
    Post count: 31206

    1st thing that I notice is that this :

    
    
    if(isset($tab_array['specials'])){
    $new_tab_array['related_listing'] = $tab_array['specials'];// set in new array
    unset($tab_array['specials']);//unset in old one
    }

    should be

    
    
    if(isset($tab_array['specials'])){
    $new_tab_array['special'] = $tab_array['specials'];// set in new array
    unset($tab_array['specials']);//unset in old one
    }

    Let us know,

    #30254

    merchbroker
    Expired Member
    Post count: 32

    Thanks for looking..

    Nothing changed at all. What am I missing here?

    #30276

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    there are 2 big mistakes.

    1st The comment

    /***************************************************ReOrderTabs*******************************************************

    was not closed with a / and all code below wasn’t excecuted.

    2nd you were using 2 hooks/functions to add and reorder tabs and both have the same names:

    
    
    
    add_filter(‘geodir_detail_page_tab_list_extend’, ‘geodir_detail_page_tab_list_extend’) ;
    
    function geodir_detail_page_tab_list_extend($tab_array)
    {
    // code here 
    }

    While you only needed 1 hook/function to add and reorder tabs at once, by adding the code below where ever u want it in the function to re-order tabs and deleting the 1st function to add the tab:

    
    
    
    $new_tab_array['specials'] = array( 
              'heading_text' =>  __('$10 LUNCH! Menu',GEODIRECTORY_TEXTDOMAIN),
              'is_active_tab' => false,
              'is_display' =>  apply_filters('geodir_detail_page_tab_is_display', true, 'specials'),
              'tab_content' => ''
             );

    Needs to be $new_tab_array.

    I’ve added it correctly to your website. Next time for a similar customization you should directly post in the Jobs forum.

    Thank you

    #30515

    merchbroker
    Expired Member
    Post count: 32

    Thank you for your help! I notice two things now.

    #1 for some reason, my “review” tab is empty.

    #2 while I selected my first tab to be active, I can’t seem to disable the profile tab from being active.

    #30594

    Paolo
    Site Admin
    Post count: 31206

    1 ) GeoDirectory listings are wordpress custom post types and reviews are comments, so the plugin “Simple No Comment” will not work for your needs, unless it allows to select for which post type comments are disabled.

    2 ) You need to unset the post_profile tab from being active.

    
    
    if(isset($tab_array['post_profile'])){
    $new_tab_array['post_profile'] = $tab_array['post_profile']; // set in new array
    $new_tab_array['post_profile']['is_active_tab']='';
    unset($tab_array['post_profile']);//unset in old one
    }

    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