Site logo

[Resolved] fix footer on the bottom

Home Forums Support [Resolved] fix footer on the bottom

Home Forums Support fix footer on the bottom

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1580580
    ken

    Hi,

    I would like to fix an additional footer at the bottom for the mobile site. I read the footer document but couldn’t find what I need. Could you help me out here?

    I have created a widget for it but don’t know how to add an additional footer only to the mobile and also fix the position at the bottom as in it’ll always be visible. Maybe something like position:absolute; bottom:0px;.

    This is the site I would like to have the footer fixed at the bottom.

    Thanks!

    #1580768
    Ying
    Staff
    Customer Support

    Hi Ken,

    Just to make sure that you want the “Follow us” widget to be sticky to the bottom on mobile?
    Let me know 🙂

    #1581585
    ken

    Hi Ying,

    Not sure what you mean by “Follow us” widget, but what I want is a bar that is sticky to the bottom and in the middle of the bar there’s an icon that links to a page. Just like the mobile menu but without the menu and on the bottom instead of above.

    Thanks!

    #1581738
    David
    Staff
    Customer Support

    Hi there,

    you can create a new Block Element:

    https://docs.generatepress.com/article/block-element-overview/

    1. Use GenerateBlocks Container Block to create the Bar, and add what other buttons etc you need to it.

    2. Select the Container Block and in settings > Advanced > Additional CSS Class(es) add 2 clases: sticky-footer hide-on-desktop

    3. Then in the Element settings leave the Block Type as Hook
    4. In the Hook field select generate_after_footer
    5. Set the Display Rules to Entire Site or wherever you want it displayed.

    Once thats done you should see your custom footer bar on the page.
    Now we need to add some CSS:

    @media(max-width: 768px) {
        body {
            margin-bottom: 80px; /* adjust this to the height of the custom footer */
        }
        .sticky-footer{
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
        }
    }
    #1581985
    ken

    Hi there,

    Thanks! Most of the things work, the only thing I am struggling with right now is the class deosn’t seem to be working, both hide-on-desktop and sticky-footer, I added the class but it doesn’t do the trick. Could you help me out here?

    #1582196
    David
    Staff
    Customer Support

    Oops couple of things:

    1. I made a typo in the CSS above – updated here
    2. You need to select the Container Block and add the sticky-footer hide-on-desktop classes, currently you have them applied to the Image Block.

    #1582443
    ken

    Works now, thanks!

    #1582527
    David
    Staff
    Customer Support

    Glad to be of help!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.