0

I'm trying to make my wordpress blog responsive for mobile devices. I was able to customize homepage in style.css, but I'm having some problems with single post page.

The problem is: I have three columns and I want to remove right and left sidebars. But they are not id like on homepage, but classes.

Single post page has one id (#postcolumn) with 3 classes: .leftsidebar, .postzone and .rightsidebar. How do I remove .leftsidebar and .rightsidebar?

Here is my code for homepage, which is working great...

@media only screen and (max-width: 480px) {
    #wrapper, #header, #column {
        width:400px;
    }

    #middlecolumn, #rightcolumn, #header, #footer {
        display:none
    }
}
1
  • 1
    A pound / sharp # indicates an id as your #header shows. A class is indicated by a dot . as in .sidebar or div.sidebar Commented Apr 16, 2015 at 18:42

1 Answer 1

1

If I understand your question correctly, your HTML markup for your single post page looks something like the following:

<div id="postcolumn">
  <div class="leftsidebar">
    // something
  </div>
  <div class="postzone">
    // something
  </div>
  <div class="rightsidebar">
    // something
  </div>
</div>

Applying the same logic as your home page, the CSS would look like:

@media only screen and (max-width: 480px) {
    #wrapper, #header, #column {
        width:400px;
    }

    #middlecolumn, #rightcolumn, #header, #footer, #postcolumn .leftsidebar, #postcolumn .rightsidebar {
        display:none
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.