modifying function leaf_comment in child theme
-
I was stuck on this for a while and just figured it out. Maybe this will help someone else. From the description in the file includes/template-tags.php ” * To override this walker in a child theme without modifying the comments template
* simply create your own leaf_comment(), and that function will be used instead.” It looked like I should be able to copy includes/template-tags.php into my child theme, modify the leaf_comment function, and change the output of my comments.WRONG! the answer is to copy /create the function(s) you want to modify into your otherwise empty functions.php.
I looked at the recommended leaf child theme, which only discusses removing functions that aren’t in proper wrappers and does not apply here. I tried all sorts of silliness to get the function file in my child’s includes folder to load – giving it a new name so as to not conflict with the parent and so on. In hindsight maybe it should have been obvious to just put naked functions in the child’s functions.php. I feel stupid already. Yea I read all about child themes, but those instructions don’t assume that the parent functions.php is including external files. That threw me.
If only that comment had said “…simply create your own leaf_comment() in functions.php, and that function will be used instead.”
I love WordPress, but sometimes the hoops we have to jump through just to change a few lines of text …
The topic ‘modifying function leaf_comment in child theme’ is closed to new replies.
