最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - How can I & how do I change text displayed in comment via child theme

programmeradmin0浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 0

You 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.

发布评论

评论列表(0)

  1. 暂无评论