wordpress テンプレート関連tips
ダイナミックウィジェット
[外観]の[ウィジェット]というのがある。[サイドバー1]に表示させたいウィジェットをドラッグすると、 sidebar.php において、
<?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> <!-- ウィジェットがあるときに"表示させたくない"ものを記述 --> <?php endif; ?>
の分岐部分に li要素で囲まれたウィジェットが表示される。