WordPress.org

Forums

Child theme template file not overwriting (7 posts)

  1. pacovalverde
    Member
    Posted 3 years ago #

    I read in the codex about template files and Child themes:

    Templates in a child theme behave just like style.css, in that they override their namesakes from the parent. A child theme can override any parental template by simply using a file with the same name.

    I have created a child theme with the style.css file and the changes in style I do in this file are working, but when I add a template file in my child theme with the same namesake as the parent's there is not override of any kind. Am I missing something? Thank you...

  2. Robert.Vidrine
    Member
    Posted 3 years ago #

    @pacovalverde,
    Can you give me specific examples? This functionality definitely does work. I have in the past created a file in my child theme to override a parent template, thinking that it was used for a specific type of post or page, but instead another file was used, so I didn't see the results I was expecting.
    Could it be that the item you're looking at in your browser actually depends on a file other than the one you've overridden?

  3. pacovalverde
    Member
    Posted 3 years ago #

    Yes, it has to do with TEMPLATEPATH and changing it with STYLESHEETPATH in some cases and having to work with, what you say, other files than the one I am working with, which it depends on in some way. So I see, it isn't "simply using a file with the same name" as the codex says in some cases... I have seen in the internet many resources and examples about using the style.css and functions.php in child themes but almost none at all about using template files.

  4. pacovalverde
    Member
    Posted 3 years ago #

    @Robert.Vidrine thank you...

  5. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    What Theme, specifically, are you using?

  6. pacovalverde
    Member
    Posted 3 years ago #

    Templatic's Automobile

  7. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Templatic is a commercial Theme shop, so you should consult their support offerings.

    (We can't help, even if we want to. We don't have access to the Theme files, to help you figure out what's wrong.)

    But, that said, the issue very likely is referencing the path to the template rather than to the stylesheet.

Topic Closed

This topic has been closed to new replies.

About this Topic