我想要创建一个子主题覆盖在我父主题的一些功能WordPress的儿童主题include_once
我有这个在父母的functions.php主题
include_once('admin/functions-extended/fn-typography.php'); //User Typography
这是我的尝试:
include_once(get_stylesheet_directory().'admin/functions-extended/fn-typography.php');
但不起作用
详情
我试图在这个文件中,但在儿童主题添加自定义字体 父FN-typography.php代码
function mgm_get_google_fonts() {
// Google Font Defaults
$google_faces = array(
"Abel" => "Abel",
"Abril Fatface" => "Abril Fatface",
"Aclonica" => "Aclonica",
"Acme" => "Acme",
"Actor" => "Actor",
"Adamina" => "Adamina",
"Advent Pro" => "Advent Pro",
"Aguafina Script" => "Aguafina Script",
"Aladin" => "Aladin",
"Aldrich" => "Aldrich",
"Alegreya" => "Alegreya",
"Alegreya SC" => "Alegreya SC",
"Alex Brush" => "Alex Brush",
"Alfa Slab One" => "Alfa Slab One",
"Alice" => "Alice",
"Alike" => "Alike",
"Alike Angular" => "Alike Angular",
"Allan" => "Allan",
);
return $google_faces;
}
我想删除该字体,并添加另一种字体
你试图使用FN-typography.php或覆盖呢? – bobdye 2015-02-08 20:48:47
@bobdye即时通讯试图超越它 – 2015-02-08 21:23:06
你有完全相同的目录结构中的同名文件,你的孩子主题?另外,父函数.php是否允许?如果你只是再次包含一个函数,你会得到一个“重复函数名称”错误。 – bobdye 2015-02-08 21:54:19