• How do I create a child theme which will inherit ALL of the code from the original theme?

    Do I copy all of the folders in the original theme folder to the child theme folder make the child theme folder the first searched directory? If yes, could you provide step by step instructions?

    I would like to attempt this on the local desktop app and if successful, on a site I am building which is not live. Will the process be the same?

    I would like to ask where do I locate the .php folders/files so that I may copy and edit the code? How do I give the child file priority over the parent file?

    Could you direct me to valid code snippet source?

    • This topic was modified 7 years, 10 months ago by jcruz0.
Viewing 1 replies (of 1 total)
  • Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    Hi there,
    not sure what do you mean with “inherit”.
    The best way to understand what is a WordPress child-theme and how it works is to read the wp.org documentation:

    https://codex.ww.wp.xz.cn/Child_Themes
    https://developer.ww.wp.xz.cn/themes/advanced-topics/child-themes/

    Do I copy all of the folders in the original theme folder to the child theme folder make the child theme folder the first searched directory?

    This won’t work for all the themes, and even if it worked for your specific theme, it actually would make any update of the parent theme “useless” as your child-theme would always override the parent theme files. Depending on how the parent theme has been developed, copying files from the parent to the child (respecting the parent theme directory three, might even break your site: e.g. blank page == PHP fatal errors).

    In any case, as you can see in the documentation linked above, the child-theme functions.php is always executed before the parent theme functions.php: you cannot avoid the execution of the parent theme functions.php file.

    I would like to attempt this on the local desktop app and if successful, on a site I am building which is not live. Will the process be the same?

    I would like to ask where do I locate the .php folders/files so that I may copy and edit the code? How do I give the child file priority over the parent file?

    As said above, it highly depends on how the parent theme has been developed, it might allow or not the child-theme overriding for one or more files. For allowed files, your child-theme ones will be always executed in place of the parent one, there’s no much you can do for the others though.

    The only exceptions are the WordPress theme template files, which are loaded by the WordPress core code, and that you can always override in your child-theme, whatever is the parent theme.

    Hope this might help.
    I set this ticket as “not a support question” as it doesn’t concern this plugin usage/functionality.

Viewing 1 replies (of 1 total)

The topic ‘Switching Childify directory priority’ is closed to new replies.