Ready to get started?Download WordPress


How to make side bar disappear on a page, not a post (9 posts)

  1. thethievingbear
    Posted 1 year ago #

    I am trying to make my side bar disappear on the page that say Coupons.com at the top of my blog because the side bar is cutting off the coupons. You can find me at thethievingbear.com and TIA.

  2. Each WP page has a unique ID. You would need to write a custom function using a conditional to check for that particular page ID... and then, hide the sidebar.


    EDIT: You may also have luck using a plugin like "Widget Logic" to control what widgets get displayed on what page.

  3. alchymyth
    Forum Moderator
    Posted 1 year ago #

    alternatively, you could do it all with css;
    add this to the bottom of style.css of your theme:

    .page-id-25787 #primary { display: none; }
    .page-id-25787 #content { width: 730px; margin: auto; }
    .page-id-25787 #main { background: #fff; }
  4. thethievingbear
    Posted 1 year ago #

    SWeet! That worked and it was simple! Thanks so much alchymyth!

  5. alchymyth... leave it to you to remember option 3 ;)

  6. thethievingbear
    Posted 1 year ago #

    So, I added the code like alchymyth had said and it looks fine to me, but my readers are reporting differently. I wonder why this is happening? Perhaps different browsers? I know very little when it comes to coding and the like. Any suggestions would be greatly appreciated.

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    I don't see the sidebar in Firefox, Safari or Chrome, but your page has a bunch of errors, so maybe those are causing problems in IE?


  8. alchymyth
    Forum Moderator
    Posted 1 year ago #

    browser caches can be very persistant;

    unless the content of a webpage is changed, the browser might just ignore the new css and work from the cached styles.

    your readers possibly need to clear the browser cache to get to see the new version of the page.

  9. thethievingbear
    Posted 1 year ago #

    I am in IE and am not having any problems. I will suggest clearing the caches to my readers and try fixing the errors. Thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Topic