如何为所有博客帖子和博客列出的页面显示不同的侧边栏?

时间:2012-01-09 11:09:37

标签: wordpress

我有一个wordpress网站,有4页,一页是博客页面。 我为博客页面创建了一个页面模板,以显示此页面上的所有博客。 在此页面模板上,我显示与其他页面不同的侧边栏。 此侧栏显示博客档案。

但是当我点击存档时,侧边栏会更改为第一个侧边栏,也会在另一个页面上。

我将如何保留第二个侧边栏以显示在每篇博文上?

提前致谢。

3 个答案:

答案 0 :(得分:0)

您需要在每个窗口小部件上显示它应显示的条件(在哪个页面上)。 通过获取页​​面ID或网址,您可以提供此条件。

其他简易选项使用插件

http://wordpress.org/extend/plugins/wp-custom-widget/

http://wordpress.org/extend/plugins/slayers-custom-widgets/

答案 1 :(得分:0)

还有一个名为“Display Widgets”的插件

http://wordpress.org/extend/plugins/display-widgets/

一切顺利, 貂

答案 2 :(得分:0)

- In case of custom pages,for example we are having aboutus.php having body contents like 
  this -

  <?php
  /**
   * Template Name: About us
   *
   * Selectable from a dropdown menu on the edit page screen.
   */
  ?>
  <?php get_header(); ?>

     //body content for aboutus page

  <?php include ('aboutus_sidebar.php'); ?>//separate sidebar for aboutus
  <?php get_footer(); ?>

- Then,create a file named aboutus_sidebar.php with whatever you want.