Overriding child theme files on the main theme

This topic has 4 replies, 3 voices, and was last updated 8 years, 5 months ago ago by Stan Russell

  • Avatar: Rawi7
    Rawi
    Participant
    May 15, 2016 at 14:54

    In relation to this topic (https://www.8theme.com/topic/translate-brand-text-from-link/), whenever the theme is updated I must make the same change.

    I copied the same file on the child theme but the change is not overwritten the main theme.

    Can you tell me how to make this change permanently?

    Thank you.

    3 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    May 16, 2016 at 10:27

    Hello,

    Please try to add this function into the function.php file of Child Theme and make change there.

    function et_create_brand_taxonomies() {
    		$labels = array(
    			'name'              => _x( 'Brands', ETHEME_DOMAIN ),
    			'singular_name'     => _x( 'Brand', ETHEME_DOMAIN ),
    			'search_items'      => __( 'Search Brands', ETHEME_DOMAIN ),
    			'all_items'         => __( 'All Brands', ETHEME_DOMAIN ),
    			'parent_item'       => __( 'Parent Brand', ETHEME_DOMAIN ),
    			'parent_item_colon' => __( 'Parent Brand:', ETHEME_DOMAIN ),
    			'edit_item'         => __( 'Edit Brand', ETHEME_DOMAIN ),
    			'update_item'       => __( 'Update Brand', ETHEME_DOMAIN ),
    			'add_new_item'      => __( 'Add New Brand', ETHEME_DOMAIN ),
    			'new_item_name'     => __( 'New Brand Name', ETHEME_DOMAIN ),
    			'menu_name'         => __( 'Brands', ETHEME_DOMAIN ),
    		);
    
    		$args = array(
    			'hierarchical'      => true,
    			'labels'            => $labels,
    			'show_ui'           => true,
    			'show_admin_column' => true,
    			'query_var'         => true,
                'capabilities'			=> array(
                	'manage_terms' 		=> 'manage_product_terms',
    				'edit_terms' 		=> 'edit_product_terms',
    				'delete_terms' 		=> 'delete_product_terms',
    				'assign_terms' 		=> 'assign_product_terms',
                ),
    			'rewrite'           => array( 'slug' => 'brand' ),
    		);
    
    		register_taxonomy( 'brand', array( 'product' ), $args );
    	}
    

    Regards,
    Robert Hall

    Avatar: Rawi7
    Rawi
    Participant
    May 23, 2016 at 18:26

    Hello Robert,

    The function works correctly.

    Thank you!

    Avatar: stan
    Stan Russell
    Participant
    May 24, 2016 at 07:09

    Hello Rawi7,

    you are welcome!

    Regards,
    Stan Russell.

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘Overriding child theme files on the main theme’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.