This isn't a specific theme I'm asking for, well, yes it is, but I assume the answer would work on any theme..
I've recently learned little about child theme, but I'm not understanding how to change stuff. For example, the following code (see screenshot)
This is the main themes comments.php, and as I've leavene learned, you shouldn't change the themes code, and instead modify the child theme.
But how? If I for example wants to change the marked text to: One idea, idea & ideas, I would normally just change it, but not when you're using child theme.
So what do I do? Copy the php snippet and create a new comments.php in my child theme directory? Should I MOVE the code from the mother theme to the child? .. Or is it more complicated than that?
This isn't a specific theme I'm asking for, well, yes it is, but I assume the answer would work on any theme..
I've recently learned little about child theme, but I'm not understanding how to change stuff. For example, the following code (see screenshot)
This is the main themes comments.php, and as I've leavene learned, you shouldn't change the themes code, and instead modify the child theme.
But how? If I for example wants to change the marked text to: One idea, idea & ideas, I would normally just change it, but not when you're using child theme.
So what do I do? Copy the php snippet and create a new comments.php in my child theme directory? Should I MOVE the code from the mother theme to the child? .. Or is it more complicated than that?
Share Improve this question asked May 5, 2020 at 19:31 JoBeJoBe 1712 silver badges11 bronze badges2 Answers
Reset to default 0You should copy comments.php in the child theme and then make the changes there.
NOTE: DO NOT DELETE THE FILE FROM THE PARENT THEME.
You can read more about parent and child theme here: https://developer.wordpress/themes/advanced-topics/child-themes/
Child themes work by copying just the file(s) you want to modify into the child theme folder. So the original should still exist in the parent theme, and you have a copy in the child theme which you then modify. The only other requirement for a child theme is that you must have a style.css
file with at least a couple of comments, so that you identify the parent theme and WP knows to use the child theme in unison with the parent.