• Hello,

    I want that my child theme replace the file /functions/theme-option.php with my theme-option.php

    so in my child-theme folder I created a directory /functions/theme-option.php and then I edited the functions.php in this way :

    <?php
    /************** Child Script *********/
    
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    
    /********** Includes **********/
    require_once( get_stylesheet_directory() . '/functions/theme-options.php' );
    ?>

    But unfortunally this give my a cannot_redeclare error.

    Can you please help ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What is the full error? Cannot redefine ‘theme_enqueue_styles’ function?
    Rename the function if so.

    Thread Starter vrrebels

    (@vrrebels)

    No the error is cannot redeclare “path to parent” theme-option.php to “path to children” theme-option.php

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Replace theme-option.php’ is closed to new replies.