2016-06-10 59 views
0

我的wordpress頁面上的東西似乎有問題,因爲小部件沒有顯示,但我不確定如何編輯小部件。在Wordpress中編輯'側邊欄'

在外觀下homepage.php代碼>編輯器是

<section class="row post_content"> 

    <div class="col-sm-8"> 

    <?php the_content(); ?> 

    </div> 

    <?php get_sidebar('sidebar2'); // sidebar 2 ?> 

</section> <!-- end article header --> 

我會在哪裏找到代碼「sidebar2」作爲在邊欄應該顯示

在頁面上顯示一條錯誤消息的那一刻

回答

1

如開發人員手冊get_sidebar()所述,您的邊欄文件應該被稱爲sidebar-sidebar2.php。該文件將出現在活動主題的根目錄中。

get_sidebar()掛鉤允許使用特定的側邊欄模板文件來代替默認側邊欄模板文件。如果你的文件被稱爲sidebar-new.php,你可以在hook中指定文件名爲get_sidebar('new')。