0
我正在做我的第一個WordPress主題,我正在學習API自定義。但是我的代碼有些問題。怎麼了?當我加載wp-admin頁面時,它顯示爲空白。Wordpress API自定義問題
這是PHP代碼
//Welcome Message Settings
$wp_customize->add_setting('welcome_message' , array(
'default' => 'hi',
));
$wp_customize->add_section('test_welcomemessage' , array(
'title' => __('Welcome Message','my_test'),
'description' => 'Write your own Welcome Message for your visitors'
));
$wp_customize->add_control('welcome_message', array(
'label' => __('Welcome Messagee', 'mytheme'),
'section' => 'test_welcomemessage',
'settings' => 'welcome_message'
)));
}
這是HTML結構
<div id="welcomecontainer">
<div class="welcomemessage"><?php echo get_theme_mod('welcome_message'); ?></div>
</div>
什麼問題在這個代碼? 謝謝