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
  • Author
    Posts
  • #63866

    jcavens
    Expired Member
    Post count: 30

    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;
    		
    	}
    }
    #63928

    Paolo
    Site Admin
    Post count: 31206

    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!

    #63954

    jcavens
    Expired Member
    Post count: 30

    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!

    #63955

    jcavens
    Expired Member
    Post count: 30

    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!

    #63961

    Paolo
    Site Admin
    Post count: 31206

    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!

    #63974

    jcavens
    Expired Member
    Post count: 30
    This reply has been marked as private.
    #63999

    jcavens
    Expired Member
    Post count: 30

    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!

    #64002

    Giri
    Expired Member
    Post count: 3155

    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!

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