1
我剛剛瞭解瞭如何創建自定義WordPress主題。我想爲我的側欄指定一個類來創建樣式,但是我沒有在網上找到任何解釋如何執行此操作的內容。我加入到我的functions.php文件中的代碼註冊我的側邊欄是:如何在WordPress中爲自定義邊欄添加一個類
if (function_exists('register_sidebar')) register_sidebar(array( 'id' => 'sidebar-1', 'description' => __('Add widgets here to appear in your sidebar.', 'twentysixteen'), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ));
我加入到我的sidebar.php文件中的代碼是:
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
<?php endif; ?>
任何幫助將不勝感激!