0

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?

0

As 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.