0

例如,我希望边栏 A 只显示一个文本小部件,而边栏 B 只显示文本小部件。我怎样才能做到这一点?

4

1 回答 1

0

只需制作两个文件sidebarA.php并将这两个文件sidebarB.php都包含在您的page.php

在侧边栏 A 中:

 <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("your_text_widget")  ) : ?>

在侧边栏 B 中:

<?php  if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("your_widgets1")  ) : ?>
<?php  if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("your_widgets2")  ) : ?>
<?php  if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("your_widgets")  ) : ?>
于 2013-06-20T12:02:38.680 回答