| 开发者 | quicksloth |
|---|---|
| 更新时间 | 2026年10月29日 07:53 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
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.
How it is built
position: sticky where the column allows it; otherwise a fixed-position fallback with a placeholder that recalculates the width on zoom, resize and rotation./wp-content/plugins/ and activate it under Plugins.Activate this plugin before you delete Fixed Widget: deleting it removes its settings, which this plugin imports on activation (the widgets and blocks you marked stay sticky either way). Then deactivate it on the Plugins page; until then this plugin moves nothing. Not imported: "logged_in_req" (sticky only for logged-in users) and "Improved version" (position: sticky is always tried first). The stop at the theme footer starts off, as before. While pinned, elements also get the FixedWidget__fixed_widget__pinned class, so your CSS keeps working. This plugin is not affiliated with Fixed Widget or its authors.
Most block themes have no widget areas. Under Appearance → Editor, open the template or template part that holds your sidebar, select the block to keep in view (for example a Group block inside a column) and turn on Sticky in its Sticky panel.
Check these:
Yes; clear the cache after changing widgets or settings. We tested LiteSpeed Cache 7.9.2 with JavaScript and CSS minified and combined and Load JS Deferred set to Deferred: sticky elements work as without it.
With Load JS Deferred set to Delayed, scripts run only after the first interaction, so nothing is sticky until the visitor moves the mouse over the page, uses the wheel, a key or a touch. If a widget must be sticky before that, add quicksloth-sticky-widget to JS Deferred / Delayed Excludes (tested: the slug is enough). Other plugins with a similar "delay JavaScript" feature behave the same way; we have tested this only with LiteSpeed Cache.
It adds one script of about 5 KB compressed, no CSS and no other request, only on pages with a sticky element. In our Lighthouse test on mobile the score was the same with and without the plugin, 99 on Twenty Twenty-Five and 98 on Astra, with Total Blocking Time 3 to 6 ms higher.
Under Appearance → Sticky Widget raise Layer (z-index) (50 by default) when the element goes behind the content, lower it when it covers a fixed header; with a fixed header also set Margin top to its height.
The plugin is ready for translation (.pot file in languages/). Translations into Italian, German, Spanish, French, Portuguese (Brazil) and Dutch were drafted with AI (Claude) and submitted to translate.wordpress.org, where volunteer editors review them before they reach your site. Until a language is approved there, the texts are shown in English.
After adding content with JavaScript (infinite scroll, tabs), call window.qssw.refresh() to find and measure the sticky elements again. Classes: qssw-sticky on an element to keep in view, qssw-stop on an element it must not cover, qssw-is-pinned while it is pinned.