admin管理员组文章数量:1130349
I am using wordpress for my site. I am using a theme called esplanade. I have made a child theme folder and created a style.css with the required lines in it. My child theme is working nicely.
I have functions.php in my original theme. I want to edit a function in it which creates an author box below the article.
I heard that we can create a new function in the child theme functions.php but cannot edit the existing function.
I dont want to edit in the main theme folders funcions.php file. because tomorrow if i update then it will create a problem.
I am using wordpress for my site. I am using a theme called esplanade. I have made a child theme folder and created a style.css with the required lines in it. My child theme is working nicely.
I have functions.php in my original theme. I want to edit a function in it which creates an author box below the article.
I heard that we can create a new function in the child theme functions.php but cannot edit the existing function.
I dont want to edit in the main theme folders funcions.php file. because tomorrow if i update then it will create a problem.
Share Improve this question asked Feb 15, 2014 at 8:42 SanthoshSanthosh 1931 gold badge3 silver badges9 bronze badges1 Answer
Reset to default 3Nearly all functions in esplanade can be overwritten in a child theme. Take the esplanade_admin_header_style() function for instance. Just before that function is the following line of code if ( ! function_exists( 'esplanade_admin_header_style' ) ) :
. The important part here is if ( ! function_exists()): This means that the function it calls can be overwritten in a child theme. It is always a good practice for parent theme authors to include this function if they want to make their theme child theme friendly.
What this all means now is that you can copy the whole function esplanade_admin_header_style() { code in here } function to your child theme and edit the code as you need and that function will then be used instead of the parent theme's function. It is important here to keep the same name for that function. So your function will look like this function esplanade_admin_header_style() { my new code in here }. Just one more thing to keep in mind, don't copy the if ( ! function_exists( 'esplanade_admin_header_style' ) ) :
part to your theme.
I am using wordpress for my site. I am using a theme called esplanade. I have made a child theme folder and created a style.css with the required lines in it. My child theme is working nicely.
I have functions.php in my original theme. I want to edit a function in it which creates an author box below the article.
I heard that we can create a new function in the child theme functions.php but cannot edit the existing function.
I dont want to edit in the main theme folders funcions.php file. because tomorrow if i update then it will create a problem.
I am using wordpress for my site. I am using a theme called esplanade. I have made a child theme folder and created a style.css with the required lines in it. My child theme is working nicely.
I have functions.php in my original theme. I want to edit a function in it which creates an author box below the article.
I heard that we can create a new function in the child theme functions.php but cannot edit the existing function.
I dont want to edit in the main theme folders funcions.php file. because tomorrow if i update then it will create a problem.
Share Improve this question asked Feb 15, 2014 at 8:42 SanthoshSanthosh 1931 gold badge3 silver badges9 bronze badges1 Answer
Reset to default 3Nearly all functions in esplanade can be overwritten in a child theme. Take the esplanade_admin_header_style() function for instance. Just before that function is the following line of code if ( ! function_exists( 'esplanade_admin_header_style' ) ) :
. The important part here is if ( ! function_exists()): This means that the function it calls can be overwritten in a child theme. It is always a good practice for parent theme authors to include this function if they want to make their theme child theme friendly.
What this all means now is that you can copy the whole function esplanade_admin_header_style() { code in here } function to your child theme and edit the code as you need and that function will then be used instead of the parent theme's function. It is important here to keep the same name for that function. So your function will look like this function esplanade_admin_header_style() { my new code in here }. Just one more thing to keep in mind, don't copy the if ( ! function_exists( 'esplanade_admin_header_style' ) ) :
part to your theme.
本文标签: how to edit functionsphp in a child theme
版权声明:本文标题:how to edit functions.php in a child theme 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749042534a2307358.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论