Taking out header/sidebar from just one page

by
redstanford
Profile picture of redstanford
Posts: Threads: Thanks: Account age: less than a second
4 replies
how do i eliminate the header and sidebar on just one of my pages of my wordpress blog?
#header or sidebar #page #taking
    • Profile picture of the author LakiPolitis
      LakiPolitis
      Profile picture of LakiPolitis
      Posts: Threads: Thanks: Account age: less than a second
      You can add css on the page itself. So use Google chrome to inspect an element. Then, for that specific page, go into the code, in the head add:

      HTML Code:
      <head>
      <title>...</title>
      <style type="text/css">
          div.mainCont div #specificID { display: none; }
      </style>
      so here's the break down:

      div.mainCont -you're selecting the div with the class "mainCont" yours good be different

      div - then you're looking for any divs inside of that

      #specificID - then you're looking for a specific element with a specific ID.

      display: none; you're changing its display from block, inline, etc to none. it will not show up period. No height, no margin, no width, no nothing. Poof. Gone.

      Use inheritances xxx xxx xxx #yyy to make sure that you're not affecting anything other than what you want. And make sure you use IDs effectively. An ID is never repeated, so when you use inheritances and the IDs, you essentially nullify the danger of accidentally styling another element.
      • Profile picture of the author Istvan Horvath
        Istvan Horvath
        Profile picture of Istvan Horvath
        Posts: Threads: Thanks: Account age: less than a second
        Originally Posted by LakiPolitis View Post

        Then, for that specific page, go into the code, in the head add:
        Except that in WordPress all the pages are using the same header.php file of the theme... :rolleyes:
        Signature

        • Profile picture of the author LakiPolitis
          LakiPolitis
          Profile picture of LakiPolitis
          Posts: Threads: Thanks: Account age: less than a second
          Originally Posted by Istvan Horvath View Post

          Except that in WordPress all the pages are using the same header.php file of the theme... :rolleyes:
          That's fine. Although it's frowned upon, you can add CSS like that the same as JS (which is also frowned upon) anywhere on the page. Add it in an element on that specific page.

Trending Topics