admin管理员组文章数量:1122846
I would like to add toggle style button near the left sidebar for collapsing and opening/closing the left sidebar of Wordpress default Twenty Fifteen theme.
I have this code for only removing the left sidebar:
body:before,
#sidebar,
#colophon,
.entry-footer {
display:none;
}
.site-content {
margin: 0 auto;
float: none;
width: 100%;
max-width: 1200px;
}
So how can I also add an arrow for manually opening and closing the left sidebar of twenty fifteen theme? And how to stretch whole site automatically when the left sidebar closed?
I would like to add toggle style button near the left sidebar for collapsing and opening/closing the left sidebar of Wordpress default Twenty Fifteen theme.
I have this code for only removing the left sidebar:
body:before,
#sidebar,
#colophon,
.entry-footer {
display:none;
}
.site-content {
margin: 0 auto;
float: none;
width: 100%;
max-width: 1200px;
}
So how can I also add an arrow for manually opening and closing the left sidebar of twenty fifteen theme? And how to stretch whole site automatically when the left sidebar closed?
Share Improve this question asked Oct 12, 2017 at 11:12 vinpinaduvinpinadu 32 bronze badges1 Answer
Reset to default 0As you've done, you removed the sidebar with CSS, however to display on a toggle you'll have to use jQuery. You could do something with toggleClass(); on a click function.
In your css you simply add the class that will toggle and then display the sidebar again.
Stretching the site automatically will rely on CSS again. Let me know if there is anything specifically I can help with.
本文标签: phpHow to add OpenClose Toggle button into Twenty Fifteen theme for hiding left sidebar
版权声明:本文标题:php - How to add OpenClose Toggle button into Twenty Fifteen theme for hiding left sidebar? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736288496a1928106.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论