WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. thethievingbear
    Member
    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.

    http://codex.wordpress.org/Conditional_Tags

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

  3. alchymyth
    The Sweeper & 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
    Member
    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
    Member
    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?

    http://validator.w3.org/check?uri=http%3A%2F%2Fthethievingbear.com%2Fprint-coupons-with-zip-code-changes%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

  8. alchymyth
    The Sweeper & 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
    Member
    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

Tags