Forums

[resolved] hide footer of a specific page with css (7 posts)

  1. raduletzgo
    Member
    Posted 1 year ago #

    I am using a theme that is showing a footer on every page. the footer is okay and I want to keep it, but I am trying to remove it on a specific page.

    So here's what I got so far

    #footer p.credits this is the footer,

    #page-231 the specific page

    {display:none; } and this is the command.

    I know this sounds completely stupid, but how do I connect all three to make one usable command for my stylesheet (or is this impossible)?

  2. @mercime
    Member
    Posted 1 year ago #

    add this to your style.css - btw I think its a class page-231 not ID if your theme has body-class function
    body.page-231 #footer p.credits {display: none; }

  3. raduletzgo
    Member
    Posted 1 year ago #

    thx for the fast answer.
    I checked my header for body-class and it's there.

    So my mistake was to put # in front on page-231 ?

    I tried
    body.page-231 #footer p.credits {display:none; }
    but it didn't work for me.

    So my footer is a unique element, therefore it's id.
    #footer p.credits { font-size:.9em; Arial; font-style:italic; text-align:right; }
    This is new to me, so correct me if I'm wrong. If I add {display:none; } to the line above then the footer is not shown at all. I tried that and it worked so I must be making a mistake somewhere when I am trying to hide it on that page /?page_id=231.

  4. @mercime
    Member
    Posted 1 year ago #

    place body.page-231style after#footer p.credits style therefore in your theme's style.css it would look something like this;

    #footer p.credits { font-size:.9em; Arial; font-style:italic; text-align:right; }
    
    body.page-231 #footer p.credits {display:none; }

    If that doesn't work, need your site url.

  5. raduletzgo
    Member
    Posted 1 year ago #

    thx again for your help.

    I tried

    #footer p.credits { font-size:.9em; Arial; font-style:italic; text-align:right; }
    body.page-231 #footer p.credits {display:none; }

    but it didn't work.

    Here's the link to the site I am talking about.

  6. Kahil
    Member
    Posted 1 year ago #

    was there ever a solution for this? I have been looking for one. would be nice to have a simple solution to this rather than having to do separate custom templates/widgets/etc.

  7. Kahil
    Member
    Posted 1 year ago #

    figured it out... the theme I am using, despite being a newer one, wasn't using the body class feature.

    simply add <?php body_class($class); ?> into your body tag in your header and the page specific css will work. :)

Topic Closed

This topic has been closed to new replies.

About this Topic