Support » Theme: Mantra » PHP files in child theme

  • Resolved kraket3

    (@kraket3)


    I can’t seem to get these to work at all. I have a folder called ‘mantra-child’ where I’ve got the ‘style.css’ and ‘theme-comments.php’.

    The .css works just fine but whatever I do to the .php file it makes no difference. Everywhere I read people are saying these files are loaded before the parent ones in all cases but I’ve never gotten it to work.

    What am I doing wrong?

Viewing 1 replies (of 1 total)
  • Basic (child) theme files are automatically loaded by WordPress (like index, functions, comments, category, so on).

    Others (which are custom theme files) required being included via the child’s functions.php file to override the parent. This refers mostly to content-specific files (content-post, content-page, content-category…) and everything in the theme’s includes/ folder.

    Some of Mantra’s functions are child-proof and easily replaceable via the child themes, other (core) functions need to be unhooked and replacements hooked in their place.

    theme-comments.php is a custom Mantra file, not part of the basic WordPress theme files, so it isn’t automatically read. You need to include it via the child’s functions.php file.
    But make sure the functions defined in it are safe to replace or you unhook them first. Otherwise you’ll get errors.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP files in child theme’ is closed to new replies.