Tag WordPress
How To Use Css Position Sticky For Sticky Headers And Sidebars
An element with position: sticky behaves like a normal element until it reaches a scroll threshold, then it sticks in place. It needs no JavaScript.
How To Use Css Variables (Custom Properties) With Examples
CSS variables, also called custom properties, let you store a value once and reuse it everywhere. They are declared with two dashes and read with the var() function.
How To Register A Gutenberg Block With Plain Javascript In WordPress
You can register a simple block without a build step. Load the script in the editor with the enqueue_block_editor_assets hook and declare the WordPress packages as dependencies.
How To Lazy Load Background Images In WordPress With Intersectionobserver
WordPress already adds loading="lazy" to images. Use IntersectionObserver for things the browser cannot lazy load by itself, like CSS background images.
How To Use Jquery Correctly In WordPress
Declare jquery as a dependency and wrap your code in a function. WordPress runs jQuery in noConflict mode, so $ is not available globally.


