• Hi everybody, I have in my parent functions.php

    add_action( 'after_setup_theme', 'theme_setup' );
    function theme_setup() {
    // Add Page Meta Fields
    	require get_template_directory() . '/inc/page_meta.php';
    
    	// Add Shortcodes
    	require get_template_directory() . '/inc/shortcode.lib.php';
    }

    I want to override theme_setup() with this

    function my_theme_setup() {
    // Add Page Meta Fields
    	require get_template_directory() . '/inc/page_meta.php';
    
    	// Add CUSTOM Shortcodes
    	require get_stylesheet_directory() . '/inc/shortcode.lib.php';
    }

    from my child theme.
    I tried the methods given here but I always get an error telling me:
    Fatal error: Cannot redeclare cd_meta_box_add() …
    which is in page_meta.php.
    Many thanks

  • The topic ‘Override theme (not-pluggable) function from child theme’ is closed to new replies.