September 16, 2013 at 12:29 am #161500
Gday Enfold users
I have adjusted the functions-enfold.php file, though it does not appear to work as an override of the original parent when within my child theme. Is this file an exception to the way child themes work?
DarrylSeptember 16, 2013 at 3:29 am #161530
Child themes don’t necessarily automatically replace every file within it. They will for the WordPress core files but *not* just any other file from the theme. You need to actually register that file in your child theme or that specific function so that it doesn’t get run by the parent.
DevinSeptember 21, 2013 at 11:06 am #164382
Devin, can you take this explanation further. I am trying to simply change the text – leave a reply, want to add the the conversation etc.
I found and modified the comments.php file in the parent directory. And then uploaded the entire original file (with modifications) into the child folder. and the text changes aren’t showing up. I am assuming I am missing a step on these not core files.
first a simple question. when you change these types of files, is it best/required to upload the entire original file, or just the mods for files other than core files?
I don’t have any clue what is meant by “you need to actually register that file in your child theme” I tried looking this up but I just keep finding instructions on settign up a child theme.
Can you provide an example of how this works with the coding please.September 21, 2013 at 12:08 pm #164403
The comments file is being called by other files within the parent. For example, in the single.php file it gets included by this line:
//wordpress function that loads the comments template "comments.php" comments_template( '/includes/comments.php');
So why would your file not be included? Because the single.php isn’t pointing to your file its pointing to the file in the parent theme includes folder.
You would then need to include the single.php file in your child theme as well so that it points to your child theme includes folder and the coments.php file inside it.
Or, you could include the single.php file and change where it finds the comments.php file(maybe making it just in the general child theme files by changing the line to just comments.php).September 21, 2013 at 6:31 pm #164484
Ok I think that makes good sense to me and I will try my had at doing that. But a general question that you may know as you deal with the theme so much. Without just “knowing” How does one find/determine all the parent files that individually call the comments.php?September 21, 2013 at 8:40 pm #164531
Any file that displays the comments form will have that line in it. Right now I believe its only the single.php template for single posts.September 22, 2013 at 9:43 am #164764
The topic ‘Child theme functions-enfold file’ is closed to new replies.