Re-Order Tabs Will Not Work in Child Theme
This topic contains 7 replies, has 3 voices, and was last updated by Giri 8 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 15, 2015 at 9:02 am #63866
Hello!
I am trying to reorder the tabs on the places post type to put the Profile tab first, with Reviews second.
If I make the change to the default code in the parent theme, it works fine.
If I add the changes to my child theme, it no longer works. It does register my code though, because if I echo some random text in the new function, it shows on the places page – it just doesn’t register the tabs change for some reason.
I am so stumped, any advice? 🙂
Here is my code:
remove_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend'); add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_tab_list_extend_new'); function geodir_detail_page_tab_list_extend_new($tab_array) { if ( 'gd_place' == get_post_type() ) { global $preview; if ($preview) { return $tab_array; } $new_tab_array = array(); // here u can modify this array, u can create a completely new one too. 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'] = '1'; unset($tab_array['post_profile']);//unset in old one } if (isset($tab_array['reviews'])) { $new_tab_array['reviews'] = $tab_array['reviews'];// set in new array $new_tab_array['reviews']['is_active_tab'] = ''; unset($tab_array['reviews']);//unset in old one } if (isset($tab_array['post_map'])) { $new_tab_array['post_map'] = $tab_array['post_map'];// set in new array unset($tab_array['post_map']);//unset in old one } if (isset($tab_array['special_offers'])) { $new_tab_array['special_offers'] = $tab_array['special_offers'];// set in new array unset($tab_array['special_offers']);//unset in old one } if (isset($tab_array['post_info'])) { $new_tab_array['post_info'] = $tab_array['post_info'];// set in new array unset($tab_array['post_info']);//unset in old one } if (isset($tab_array['post_images'])) { $new_tab_array['post_images'] = $tab_array['post_images'];// set in new array unset($tab_array['post_images']);//unset in old one } if (isset($tab_array['post_video'])) { $new_tab_array['post_video'] = $tab_array['post_video'];// set in new array unset($tab_array['post_video']);//unset in old one } if (isset($tab_array['special_offers'])) { $new_tab_array['special_offers'] = $tab_array['special_offers'];// set in new array unset($tab_array['special_offers']);//unset in old one } // now we set any remaining tabs that have not been assigned an order foreach ($tab_array as $key => $tab) { $new_tab_array[$key] = $tab; } return $new_tab_array; } }
December 15, 2015 at 6:43 pm #63928A 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!
December 15, 2015 at 8:53 pm #63954A 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!
December 15, 2015 at 9:10 pm #63955A 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!
December 15, 2015 at 9:39 pm #63961A 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!
December 15, 2015 at 10:16 pm #63974This reply has been marked as private.December 16, 2015 at 6:15 am #63999A 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!
December 16, 2015 at 6:42 am #64002A 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!
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket