Quicksloth Sticky Widget – Fixed Widgets, Blocks & Sticky Sidebar
Keep a sidebar widget, a block or any element of your theme in view while visitors scroll down a long page, and stop it before the footer instead of covering it. Works with classic widgets, with any block except the Classic block (WordPress’s own Sticky covers only Group blocks, on themes that turn
Keep a sidebar widget, a block or any element of your theme in view while visitors scroll down a long page, and stop it before the footer instead of covering it. Works with classic widgets, with any block except the Classic block (WordPress’s own Sticky covers only Group blocks, on themes that turn it on) and with any element you point to with a CSS selector.
How to make something sticky
- Classic widget: under Appearance → Widgets , open the widget and tick Sticky (stays in view while scrolling) .
- Block: select it and turn on Sticky in the Sticky panel of the block settings, in the post, site and block widgets editors. Stop here marks a block that sticky blocks must not cover.
- Block theme (no Appearance → Widgets ): under Appearance → Editor , select a block in a template or template part and turn on Sticky .
- Any other element: list its ID, class or tag under Custom sticky elements on the settings page, one per line.
Settings
One page under Appearance → Sticky Widget (also from the Settings link on the Plugins screen):
- Margin top (10 px by default) and Margin bottom (0): distance from the window edges and from stop elements.
- Stop elements: selectors of elements that push the sticky element up, one per line. Also stop before the theme footer (footer, #colophon, .site-footer) is on by default.
- Custom sticky elements: selectors of other elements that should stay in view.
- Minimum screen width and Minimum screen height: below these window sizes nothing is sticky (0 = no limit).
- Devices: Desktop, Tablet, Phone. Phone is a window under 768 px, tablet 768 to 1024 px, desktop above.
- Layer (z-index) , 50 by default: raise it if a sticky element hides behind the content, lower it if it covers a fixed header.
Coming from Fixed Widget
On activation the plugin imports your Fixed Widget (q2w3) settings automatically: margins, stop elements, custom elements (bare IDs of version 5 included) and minimum width and height. Widgets ticked as fixed there, and blocks with its FixedWidget__fixed_widget and FixedWidget__stop_widget classes, stay sticky without a click. Its settings are never changed or deleted, so you can switch back. While it is still active this plugin keeps its script off (two scripts would make the same widgets jump) and the settings page says so; deactivate it and everything starts by itself.