WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] child theme question - adding sidebar.php changes (3 posts)

  1. theregoesjb
    Member
    Posted 1 year ago #

    so far i have only had a style.css file in the child theme folder. And I understand the way it works, i add CSS markup and then it loads the parent style.css markup after.

    For a .php file (such as sidebar.php, which is what im trying to add code to) I read that i just copy the original file to the child theme folder and make any edits; this file now completely replaces the original.

    Is this correct? If one of the biggest reasons to use a child theme is to avoid update issues, then this seems counter intuitive because there could be updates in sidebar.php that my child theme will totally miss and possibly have conflicts right?

    or am i wrong?

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    copy the original file to the child theme folder and make any edits; this file now completely replaces the original.

    Is this correct?

    correct

    there could be updates in sidebar.php that my child theme will totally miss and possibly have conflicts right?

    right, but unlikely.

    there will be a point depending on the numbers of edited templates, where it might make sense to pull the last few unedited templates from the parent theme into the child theme, and save it as an independant new theme (based on the parent theme, but not a child theme anymore).

    the biggest advantage of child themes is if the edits are mostly in the formatting, i.e. in the style.css

  3. theregoesjb
    Member
    Posted 1 year ago #

    ahh i see, thanks for the clarification

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.