• Greetings, cannot seem to find an answer to this. Any help would be welcomed

    I created a child theme the parent theme has a directory /php/phpfile.php that i need to modify

    So ive tried a few things and nothing works.

    I must first specify that in the original functions.php file i see a required_once statement that loads the file.

    So ive made a duplicate directory under the child theme /php/phpfile.php and made my modifications in it.

    What now ?

    I know i need to add a function in my functions.php file under the childtheme directory to run this version once. But when i do that i get a FUNCTION CAN ONLY BE DECLARED ONCE error message.

    Im learning so any explanation would be great.

    Cheers.

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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The answer will be specific to how your theme has been built, so, what theme are you using?

    Thread Starter Mitch Menghi

    (@menkom)

    Im using a premium theme from themeforest call coraline.

    I guess this would be a question for the theme developer then, i guess i was just under the impression that there was a code snip that would unregister whatever was required once and just another line of code to say, Now read this function….

    But i guess its more complicating than this.

    are you using that same “required_once” statement?

    Thread Starter Mitch Menghi

    (@menkom)

    yeah i am once ive used some code to unregiser the function.

    funny, a google search returns this thread, sorry man…

    Thread Starter Mitch Menghi

    (@menkom)

    I got this reply form the author… dont understand

    If you want to change it, you can try the change the file: /php/page-header.php

    if ( !function_exists( ‘theme_page_header’ ) ) {

    function theme_page_header()
    {
    ……..
    }

    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you bug him (not saying you’re bugging us) and say you don’t understand it? You’re paying him for support when you purchased the theme

    Thread Starter Mitch Menghi

    (@menkom)

    Yeah your right but when you buy a premium theme its not for customizations like this, only bugs and maybe how to use it…. but this is a little different…

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    In case you find yourself in no-man’s-land where neither the theme author supports you, because you’re making customisations, and the WordPress.org forums don’t support you, because you’re using a commercial theme, then you may need to consider hiring someone: http://jobs.wordpress.net

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Child theme – how to call a .php file in a subfolder?’ is closed to new replies.