Hi there.
I´m just tring to hide or remove some tabs when a category called suggest is used. I have followed these steps on this tutorial https://wpgeodirectory.com/support/topic/conditional-tabs/.
According to that, this line was added previously: if ( has_term ( ‘suggest’, ‘gd_placecategory’ ) ) {//rest of the function}
This is the code that hides the tabs when the category is set. However the tabs are still appearing. Thank for you help.
// this line tells the tabs function to run our new function to remove a tab
add_filter(‘geodir_detail_page_tab_list_extend’, ‘geodir_detail_page_tab_list_remove_tab’);
// this function removes the tab to the tabs list
function geodir_detail_page_tab_list_remove_tab($tab_array)
{
// the $post var contains all the listing info so we can add conditions
global $post;
// only remove the tab if the post type is
gd_place
if ($post->gd_placecategory==’suggest’) {
unset($tab_array[‘related_listing’]);//remove the tab
unset($tab_array[‘post_map’]);//remove the tab
unset($tab_array[‘special_offers’]);//remove the tab
unset($tab_array[‘post_images’]);//remove the tab
}
return $tab_array;
}