我添加了一个新的侧边栏
function child_register_sidebar(){
register_sidebar(array(
'name' => 'Social Media (Follow)',
'id' => 'sidebar-follow',
'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'theme-slug' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
在我的模板上,
<?php if ( is_active_sidebar( 'sidebar-follow' ) ) { ?>
<div class="follow-container">
<?php dynamic_sidebar( 'sidebar-follow' ); ?>
</div>
<?php } ?>
结果:
<div class="follow-container">
<div class="textwidget">
<a href="[full link to your Twitter]">
<img title="Twitter" alt="Twitter" src="https://socialmediawidgets.files.wordpress.com/2014/03/01_twitter1.png" width="35" height="35" />
</a>
</div>
</div>
如何删除<div class="textwidget">
或将类名更改为其他名称?