全部
筆記
2023-11-14 23:54
/* 啟用貼文格式 */ add_theme_support( '後格式', array( //一個陣列中可以指定多種格式。 'aside', //aside 'gallery', //畫廊 'image', //圖片) );
/*在管理畫面上套用貼文編輯器的樣式*/ add_editor_style(); //預設載入editor-style.css。您也可以指定您自己的檔案路徑作為參數。
//設定圖示函數custom_favicon() { echo '<link rel="快速圖示" type="image/x-icon" href="' .esc_url(get_template_directory_uri()) . '/image/favicon.ico" />' . "n"; echo '<link rel="apple-touch-icon" Sizes="180x180" href="' .esc_url(get_template_directory_uri()) . '/image/apple-touch-icon.png">' . "n"; echo '<link rel="icon" type="image/png" size="192x192" href="' .esc_url(get_template_directory_uri()) . '/image/android-chrome-192x192.png">' . "n ”; echo '<meta name="apple-mobile-web-app-title" content="您的應用程式標題">' . "n"; } add_action('wp_head', 'custom_favicon');
//省略絕對路徑//函數 edit_menu_link( $atts ) { if( !is_front_page() ){ $href = $atts['href']; if( substr($href, 0, 1) === '#' ) { $atts['href'] = home_url('/').$href; } }返回$atts; } add_filter( 'nav_menu_link_attributes', 'edit_menu_link', 10 );
// 任意標識符、描述 //函式 add_register_nav_menu() { register_nav_menu( '主選單', '主選單' ); } add_action( 'after_setup_theme', 'add_register_nav_menu' );
prev
next
<< 返回列表
頂部
首頁
樣本第 1 頁
樣本第 2 頁
樣本第 3 頁
舊網頁
訊息
唱片收藏
備忘錄
玩具相機系列
工作
輪廓
聯繫我們
報價模擬器
隱私權政策
MEMOMEMO
在functions.php中編寫的有用程式碼(第2部分)
2023-11-14 23:54
頂部
首頁
樣本第 1 頁
樣本第 2 頁
樣本第 3 頁
舊網頁
訊息
唱片收藏
備忘錄
玩具相機系列
工作
輪廓
聯繫我們
報價模擬器
隱私權政策