• Resolved Ironegg

    (@ironegg)


    Ok there was a post on this before, but it’s closed now and I’m still just a tad confused. I’ve made a child theme of twenty ten and understand how that all works. However, I have altered the footer.php file, but am looking to make a child version of THAT so THOSE changes don’t go away, if and when I update.

    The changes I’ve made aren’t huge because I know it’s good to keep the original file in tact and I wanted to consult somebody on the matter before I go messing with it any further. Besides I’ve made a back-up so no need to worry.

    So, am I supposed to make a reference to the file like so?:

    @import url(“../twentyten/footer.php”);

    and do the same thing as I did with the style.css file? If so, do I do it IN the child style.css file? If so, how exactly.

    If not, do I make another file in my child directory called footer.php and do it all separately?

    I also feel like I’m supposed to actually copy the original file itself over into my child directory somewhere along the way? Anywho, that is my question, sorry I know it’s a little convoluted right now so bear with me. I’m still trying to put together a mental schematic of it all. But any help is greatly appreciated!

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • So, am I supposed to make a reference to the file like so

    No. You are supposed to copy footer.php from the parent into the child and then amend the child’s version.

    Thread Starter Ironegg

    (@ironegg)

    Ahhh ok. Now do I copy the file into INTO my style.css file in my child directory, or just into my Child directory?

    I think the latter is what you’re telling me, but just want to be sure.

    Thread Starter Ironegg

    (@ironegg)

    oh yeah that worked. Thank you very much. I copied my modified footer.php into my child directory and restored the footer.php file in the original twentyten theme back to its orignial state, and my footer modifications remained. Excellent.

    As a side question, but related, how does wordpress know to read the footer.php file in my child folder? I thought it only knew to first read the styl.css file since I referenced the original. But it seems that wordpress will read ALL files in my child directory first?

    But it seems that wordpress will read ALL files in my child directory first?

    Yes, that’s the idea. Anything in the child theme folder will be called first, so you can modify specific parts of a theme without changing the entire parent theme.

    Thread Starter Ironegg

    (@ironegg)

    Awesome and convenient. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Making a child of a .php file?’ is closed to new replies.