A lightweight, clean, and customizable slide-in popup for WordPress.
This snippet adds a modern notification card that slides in from the left side of the screen after a short delay. It is designed to be minimal, non-intrusive, and reusable across different themes.
- Slide-in animation from the left
- Clean, modern card-style UI
- Fully responsive (mobile-friendly)
- No dependencies (pure PHP + CSS + JS)
- Shows only once per session (using sessionStorage)
- Easy to customize text and styling
- Open your theme’s functions.php file (preferably use a child theme)
- Paste the provided code at the bottom
- Save and refresh your website
- Appears 4 seconds after page load
- Stays visible for 15 seconds
- Slides out automatically
- Will not show again during the same session
Default (bottom-left):
left: 20px; bottom: 20px;
// Show delay setTimeout(..., 4000);
// Visible duration setTimeout(..., 15000);
Remove this line:
sessionStorage.setItem(sessionKey, 'yes');
- Announcements
- Notices
- Tips or onboarding hints
- Marketing messages
- UX nudges
- No external libraries required
- Works with most WordPress themes
- Recommended to use in a child theme to avoid losing changes on updates
MIT — free to use, modify, and distribute
