我想要創建一個子主題覆蓋在我父主題的一些功能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