Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
Smooth Anchor Scrolling with Header Offset
Intercepts hash-link clicks and scrolls to the target element with a configurable offset for fixed headers.
Back-to-Top Button
Injects a fixed back-to-top button that appears after scrolling 400px and scrolls to the top on click.
Dark Mode via prefers-color-scheme
Applies a full dark-mode palette through CSS custom properties when the OS dark-mode preference is active.
Skeleton Loading Shimmer Animation
Provides animated shimmer placeholder blocks (text lines, avatar, card) to show while content is loading.
Smooth Scroll with Header Offset
Enables CSS smooth scrolling globally and adds a scroll-margin-top to anchor targets so they clear a fixed header.
Custom Text Selection Color
Overrides the browser default text-selection highlight with brand colours, with a separate scheme for code blocks.
Visible Focus Outline (Accessibility)
Hides the focus ring for mouse/touch users while preserving a clear, high-contrast outline for keyboard navigation.
Responsive 16:9 Video Wrapper
Wraps iframes and video embeds in a fluid container that maintains a 16:9 aspect ratio at any viewport width.
Print Stylesheet
Hides navigation and sidebars, forces black text, and expands link URLs for a clean print layout.
Custom Scrollbar Styling
Replaces the browser default scrollbar with a slim, themed scrollbar using WebKit and Firefox APIs.
Sticky Footer Layout
Forces the page footer to stay at the bottom of the viewport on short-content pages using flexbox.
Add Page Template Name as Body Class
Appends a tpl-{slug} CSS class to the body tag derived from the active page template filename, enabling per-template styling in the front-end stylesheet.
Restrict Block Editor to an Allowed Block List
Limits the block inserter on the "post" post type to a curated set of core blocks, preventing editors from using layout or advanced blocks that may break the design.
Disable Block Editor for Specific Post Types
Disables the Gutenberg block editor for the "landing_page" and "staff_profile" post types, falling back to the Classic Editor for those content types.
Log Failed Login Attempts to a Transient
Records each failed login with the attempted username, IP address, and timestamp into a daily transient, keeping the last 100 entries for admin review.
Email Admin on New User Registration
Sends the admin a plain-text email with the new user's login, email address, and a direct link to their profile whenever someone registers.
WP-Cron Job to Republish Stuck Scheduled Posts
Schedules an hourly cron event that finds future-dated posts whose publish time has passed and publishes them, fixing missed scheduled posts.
Scheduled Weekly Cleanup of Expired Transients
Registers a weekly WP-Cron event that deletes all expired non-autoload transients from the options table to reclaim database space.
REST Endpoint: Admin Site Statistics
Registers a GET /wp-json/scseed/v1/site-stats endpoint (admin-only) that returns published post counts per public post type, total users, and software versions.
Disable REST API Access for Non-Logged-In Users
Returns a 401 Unauthorized error for all REST API requests made by unauthenticated visitors, protecting data from public exposure.
Add Reading Time Field to Posts REST Response
Registers a reading_time_minutes field on the post REST object that returns the estimated read time based on a 200 words-per-minute reading speed.
REST Endpoint: Recent Posts by Type
Registers a GET /wp-json/scseed/v1/recent-posts endpoint that returns the most recent published posts for any public post type, with count and type query params.
Allow SVG Uploads with DOM Sanitization
Enables SVG file uploads and automatically sanitizes each uploaded SVG by stripping script elements, event-handler attributes, and javascript: href values via DOMDocument.
Register a Custom Block Category
Inserts a "My Custom Blocks" category at the top of the block inserter panel for grouping site-specific custom blocks.