可湿性粉剂.功能集成到子主题中 [英] WP. Functions integration into child theme

查看:19
本文介绍了可湿性粉剂.功能集成到子主题中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个儿童主题.我将 CSS 集成到我的子主题中,并且效果很好.但现在我想对我的主题功能进行一些修改.我从我的父主题复制,例如 product-tab.php 到我的子主题中的确切方向,修改文件,保存,但刷新后我的页面没有任何变化.如果我在父主题中这样做,它会起作用.我认为我应该将该 product-tab.php 集成到我的 functions.php 文件中(我的意思是,默认情况下,信息首先从我的子主题目录而不是从父主题获取),但我没有知道如何,因为我是 PHP 编码的新手.任何人都可以举一个例子,如何将任何 PHP 文件从父主题集成到子主题.任何人都可以使用以下信息编写代码示例吗?

I made a child theme. The CSS I integrated into my child theme and it works perfectly. But now I want to make some amendments in my themes functionality. I copy from my parent theme, for example, product-tab.php to an exact direction in my child theme, modify the file, save, but after refresh no changes in my page. If I do it in the parent theme it works. I think that I should integrate that product-tab.php into my functions.php file (I mean that information first get from my child theme directory not from parent theme by default), but I don't know how because I'm a newbie in PHP coding. Can anybody give one example how to integrate any PHP file from parent theme to a child theme. Can anybody write an example of a code using the information below?

父主题方向:

/public_html/wp-content/themes/aloshop/7upframe/element

文件名:product-tab.php

子主题方向:

/public_html/wp-content/themes/aloshop-child/7upframe/element

提前致谢

推荐答案

如果您的子主题样式表正常工作,那么您已经正确地创建了子主题.仍然提醒您检查子主题 style.css 中包含的父名称的名称为模板:"

If your child theme style sheet is working then you have created the child theme properly. Still reminding you to check the name of parent name included in child theme style.css as 'Template : '

要覆盖函数,您必须从父主题复制同一层次结构中的 php 文件/函数或保持相同的文件夹文件结构.

For overwriting the functions you have to copy the php file/functions from parent theme in the same hierarchy or by keeping the same folder file structure.

如果您的函数仍在父主题下工作,只需检查您的函数被调用的位置.它可能来自父主题中未包含在子主题中的任何其他文件.在这种情况下,也将该文件包含在子主题中.

If your function is still working from parent theme just check from where your function is getting called. It may be from any other file from parent theme which is not included in child theme. In such case, include that file too to he child theme.

希望这很清楚.

这篇关于可湿性粉剂.功能集成到子主题中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆