[Resolved] Sticky buttons at bottom of mobile page

Home Forums Support [Resolved] Sticky buttons at bottom of mobile page

Home Forums Support Sticky buttons at bottom of mobile page

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #2135883
    jorge

    I found this thread but the screencasts are missing, any way to reupload them? i think i can figure it out, just needed to see how to configure these

    https://generatepress.com/forums/topic/footer-sticky-bar/

    What i would like is to have a call us button as well as a text us button incorporated into the bottom bar, not floating icons just something unobtrusive. I don’t mind hiding the copywright bar on mobile. I’d just want this bar to show up on mobile, not desktop. Thank you!

    #2135884
    jorge

    sorry, forgot url

    #2135899
    Ying
    Staff
    Customer Support

    Hi Jorge,

    You can create a block element, add the 2 buttons into it.

    Set the block element type to hook, use after_footer as the hook name, choose location according to your needs.

    To hide the buttons on desktop, you can add hide-on-desktop class to the buttons:
    https://wordpress.com/support/adding-additional-css-classes-to-blocks/

    #2135914
    jorge

    Got it to work but buttons are one on top of the other rather than side by side

    #2135926
    Ying
    Staff
    Customer Support

    Try add this CSS:

    .site-footer + .wp-block-buttons {
        display: flex;
    }
    .site-footer + .wp-block-buttons > * {
        flex: 1;
    }
    #2135932
    jorge

    That worked great, thank you. One last thing the buttons aren’t sticky as always being on the bottom of the mobile window. Also how do i hide the footer on mobile?

    #2135947
    jorge

    I figured out hiding the footer/copywright bar on mobile, just need help with the floating buttons on scroll, meaning i would like those two buttons to be always visible at the bottom. Thanks again!

    #2135983
    Fernando
    Customer Support

    Hi Jorge,

    You can modify Ying’s code to something like this to make the buttons fixed at the bottom.

    .site-footer + .wp-block-buttons {
        display: flex;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 9999;
    }
    .site-footer + .wp-block-buttons > * {
        flex: 1;
    }

    If you wish to have it sticky on mobile only, you may use this instead:

    @media (max-width: 768px) {
        .site-footer + .wp-block-buttons {
        display: flex;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 9999;
        }
        .site-footer + .wp-block-buttons > * {
            flex: 1;
        }
    }

    Kindly let us know how it goes! 🙂

    #2135987
    jorge

    I actually would like buttons hidden on desktop , Tried the sticky on mobile code but the buttons are not centered, and the request quote lettering is stacked.

    #2136037
    Fernando
    Customer Support

    I actually would like buttons hidden on desktop

    I can see that you’ve currently set it not to display on both desktop and tablet. Alternatively, here is a code for that as well:

    @media (min-width: 769px) {
    	.site-footer + .wp-block-buttons {
    		display: none;
    	}
    }

    Tried the sticky on mobile code but the buttons are not centered, and the request quote lettering is stacked.

    Can you try this code instead?

    @media (max-width: 768px) {
        .site-footer + .wp-block-buttons {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translate(-50%,0);
        z-index: 9999;
        }
        .site-footer + .wp-block-buttons > * {
            flex: 1;
        }
    }

    Hope this helps! Kindly let us know how it goes. 🙂

    #2136049
    jorge

    did not work, visit my site so you see what i mean.

    #2136059
    Fernando
    Customer Support

    Sorry about that. I mistakenly copied the previous code instead of the new code I tested.

    Here it is:

    @media (max-width: 768px) {
            .site-footer + .wp-block-buttons {
            display: flex;
            position: fixed;
            bottom: 10px;
            left: 50%;
            transform: translate(-50%,0);
            z-index: 9999;
            width: 90%;
            }
        }

    This is what it looks like from my end: https://share.getcloudapp.com/L1uW08qL

    Kindly let me know how it goes. 🙂

    #2136069
    jorge

    Looks like that worked, thank you!.

    #2136110
    jorge

    I will close this topic, thanks again!

    #2136122
    Fernando
    Customer Support

    You’re welcome Jorge! Glad to be of assistance! Feel free to reach out anytime if you’ll need assistance with anything else. 🙂

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