尝试给出一个unique ID 到每个动态侧栏,通过id
参数传递给register_sidebar()
:
register_sidebar(
array(
\'id\' => \'essential\',
\'name\' => __(\'Essential Plan\'),
\'before_widget\' => \'\',
\'after_widget\' => \'\',
\'before_title\' => \'\',
\'after_title\' => \'\'
)
);
register_sidebar(
array(
\'id\' => \'premier\',
\'name\' => __(\'Premier Plan\'),
\'before_widget\' => \'\',
\'after_widget\' => \'\',
\'before_title\' => \'\',
\'after_title\' => \'\'
)
);
register_sidebar(
array(
\'id\' => \'essential-plus\',
\'name\' => __(\'Essential+ Plan\'),
\'before_widget\' => \'\',
\'after_widget\' => \'\',
\'before_title\' => \'\',
\'after_title\' => \'\'
)
);
register_sidebar(
array(
\'id\' => \'premier-plus\',
\'name\' => __(\'Premier+ Plan\'),
\'before_widget\' => \'\',
\'after_widget\' => \'\',
\'before_title\' => \'\',
\'after_title\' => \'\'
)
);
然后按ID分别调用:
dynamic_sidebar( \'essential\' );
dynamic_sidebar( \'premier\' );
dynamic_sidebar( \'essential-plus\' );
dynamic_sidebar( \'premier-plus\' );
不过,您应该能够通过
name
或ID
:dynamic_sidebar( \'Essential Plan\' );
dynamic_sidebar( \'Premier Plan\' );
dynamic_sidebar( \'Essential+ Plan\' );
dynamic_sidebar( \'Premier+ Plan\' );
。。。除非“+”从参数中清除?