2014-05-20 13 views
0

我已决定开始一个新问题。从前面的信息one,因为我认为我错过了这一点。在主页WordPress中调用第二个边栏的正确方法?

我想在设计的博客的主要家中有2个侧边栏(在同一时间)。现在我已经实现它,但在一个凌乱的方式...

我(想)我注册了两个侧边栏,做了两个HTML代码和风格都在Css中。 但是我在php方面的知识太少,以至于我无法知道侧栏是如何在页面中调用的。我知道应该使用get_sidebar,但它只出现在代码中一次,并且作为一个函数本身。

<?php if ((!in_the_loop() && Bunyad::posts()->meta('layout_style') == 'full') OR Bunyad::core()->get_sidebar() == 'none'): // largest images - no sidebar? ?> 

(我认为这Bunyad插上部分是负责...任何一个有过问题呢?)

所以我刚才粘贴的HTML代码在那里我希望它到第二栏是。

<div class="row"> 
    <div class="col-6 main-content">(...)</div> 

<?php Bunyad::core()->theme_sidebar(); ?> <!--I think this calls the first sidebar--> 

<aside class="col-2 sidebar2"> <!--this is a copy of the code for the first sidebar that can be found in a separate file called sidebar.php --> 
    <ul> 

    <?php if (!dynamic_sidebar('cs-sidebar_publicidad')) : ?> 
     <?php _e("<li>Nothing yet.</li>", 'bunyad'); ?> 
    <?php endif; ?> 

    </ul> 
</aside> 

</div> <!-- .row --> 

cs-sidebar_publicidad是第二栏的ID,我在WP管理面板中创建它...)

任何帮助是广泛的赞赏,在此先感谢!

回答

1

添加一个侧边栏或WP页面块

相关问题