ThemeShaper Forums » Thematic


Which php files do I need to copy to my child theme folder ? How ?

(4 posts)
  • Started 11 years ago by Bluesky
  • Latest reply from tarpontech
  • This topic is not resolved
  1. Bluesky

    I have some very general questions about building a child theme :
    By reading many posts on the forum, I see sometimes that some php files have to be copied from thematic folder to the child theme folder, ex : category.php, tag.php...according to our needs.

    Question 1 : when I copy a file to my child theme folder and put some new rules inside, do I have to delete the original data that is inside the thematic one ?

    Question 2: Does this apply to all php.files ? like for example, if I want to add something to my comments. Will I have to copy the comment.php file into my child theme folder, or simply add the new functions I need inside the one in the thematic folder ?

    Posted 11 years ago #
  2. Well, for CSS, you only need the code that will override things already present in the parent theme, or adds things not present in the parent.

    For page templates, like category.php, tag.php, you only need those files in your child if you plan to modify them. If you plan to modify them, you need all the code in them, at least to start, until you've modified it sufficiently to become something...different.

    The way wordpress handles files is different depending on the file and what it does.

    For CSS, wordpress looks at the parent theme first, then to the child theme for overriding styles.

    For php files, wordpress looks first to the child theme folder, if it doesn't find anything, it then moves on the parent theme folder. If it doesn't find anything there, it uses the wordpress default layout.

    Posted 10 years ago #
  3. Hi,

    All you need to do to start your first child theme is move or copy the thematicsamplechildtheme directory up one level into your themes directory

    Here are some links that may help you:

    @ tarpontech To clarify... in terms of CSS with theme frameworks (parent/child) the child theme's stylesheet is a requirement and is the only stylesheet regarded by WordPress when using a child theme.

    Thematic is built and provided with stylesheets that can be @import(ed) into your child theme's style.css and the samplechildtheme's style.css illustrates this *but* the is no original or cascading priority given to a parent theme's stylesheet by WordPress.

    Unlike the stylesheet WordPress will first look to the child theme for template.php files and if they don't exist then it will look to the parent theme.


    Posted 10 years ago #
  4. thanks for that clarification. I've gotten so used to @import(ing) that i'm used to traversing the cascade. Sometimes Thematic makes things too easy...

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.