Popups

This is a versatile, but lightweight plugin that allows you to re-use block designs for different utilities:

Global Popup: Design your Popups in the admin and trigger them with any element (buttons, images, links etc), anywhere on your site.

Local Popup: Design a Popup unique to that page/post/cpt. Trigger it from the same page.

Extend this plugin with:

  • New Nav: Replaces the default WordPress mobile menu with a Popup – globally and/or per-page.
  • Add an Atty: Add custom attributes to linked elements like images or buttons without needing the HTML block.

Help Docs

Active 1.2.3 updated: 01/23/2026 9:00 AM

Steve's Popup allows you to create modal popups using shortcodes or Gutenberg blocks. Features include customizable triggers, animations, and responsive design.

You can create global popups in the admin that are available site-wide, or use the block to display a global popup on specific pages/posts only. The latter ensures plugin assets load on those pages without global popups being available everywhere.

  • Upload the plugin files to the /wp-content/plugins/steves-popup directory, or install the plugin through the WordPress plugins screen directly.
  • Activate the plugin through the 'Plugins' screen in WordPress.
  • Use the [steves_popup] shortcode or Gutenberg block to add popups to your content.
Features
  • Create multiple popups with unique IDs.
  • Popup content is fully editable via Gutenberg block.
  • Popup triggers can be buttons or links with customizable classes.
  • Responsive and accessible popup design compliant with WCAG 2.1 AA standards.
  • Keyboard navigation support, focus trapping, and screen reader announcements.
  • Easy to use Gutenberg block for popup containers and shortcodes for triggers.

Popup Container Block

Use the "Steve Popup" block in the Gutenberg editor to create a popup container. Set a unique popup ID and add any blocks inside the popup content area.

Popup Trigger Shortcode

Use the [steves-popup-trigger id="your-popup-id"]Button Text[/steves-popup-trigger] shortcode to create a button or link that triggers the popup with the matching ID.

Example:

[steves-popup-trigger id="contact-popup"]Contact Us[/steves-popup-trigger]

Build your popups

Global popups can be triggered from anywhere, but especially useful in blocks like headers, footers, navs, etc.

One-time popups are good when you just want to use it on a page or two.

Create a global popup:

Choose "Add Global Popup" from the admin dashboard or the top toolbar.

Set a unique Popup ID (e.g., "cool-popup").

Add content inside the block (text, images, etc.) and save your design as you normally would.*

Your popup will be assigned the given ID and a slug upon saving. You may use either when creating the trigger.

Create a 1-time popup: – The popup block and trigger must be on the same page.

Add the "Steve Pop-Up" block to any page, post or cpt. While it doesn't effect your layout, I suggest adding it towards the bottom just for order and tidyness in your content editor.

In the block's settings (on the right), set a unique Popup ID (e.g., "cool-popup").

Add your content inside the block (text, images, etc.) and save your page.*

*The modal will expand downward with larger amounts of content and the scrolling will appear in the main viewport so it stays swipable.

Using Global Popup in Block

If you want to display a global popup on a specific page/post without it being available site-wide, you can use the "Steve Popup" block with the "Use global popup" option enabled in the block settings. This renders the global popup's content on that page only, and ensures the plugin's assets (JS/CSS) are loaded on that page even if no global popups are set to load globally.

In the block's settings, check "Use global popup" and set the "Global Popup ID" to the slug of the global popup you created in the admin (under "Global Popups").

This is useful if you have no global popups defined (to avoid loading assets site-wide), but want to use global content on select pages.

Create your trigger(s)

Using the Built-in Trigger Shortcode:

My plugin provides a shortcode that creates a theme default button to open a specific popup. Use it like this: [steves-popup-trigger id="cool-popup"]Open my cool popup[/steves-popup-trigger]

Obviously, you'll replace "cool-popup" with the ID you gave your own cool popup when you created it. (You can use the ID number or slug.) This outputs an element with the class steves-popup-trigger and data-popup-id attribute, which the plugin's JavaScript uses to show the popup on click.

Trigger with elements

You can manually add the trigger class and data attribute to buttons, text, images, or other html elements. The plugin's JavaScript listens for clicks on the elements with the class .steves-popup-trigger and uses the data-popup-id to identify which popup to open.

  • Button: <button class="steves-popup-trigger" data-popup-id="your-popup-id">Open Popup</button>
  • Text Link: <a href="#" class="steves-popup-trigger" data-popup-id="your-popup-id">Click here to open popup</a>
  • Image: <img src="your-image.jpg" alt="Trigger" class="steves-popup-trigger" data-popup-id="your-popup-id" style="cursor: pointer;">
  • Any Element (div, span, etc): <div class="steves-popup-trigger" data-popup-id="your-popup-id">Custom trigger text or content</div>

• The data-popup-id matches the ID of the popup container (from the [popup id="…"] shortcode, block, or global popup slug).

• Popups close via the close button, clicking the overlay, or pressing ESC.

If you need to integrate this into a theme file or page, add the HTML directly in your content or template. For global popups, create them in the WordPress admin under "Global Popups" and use their slug or ID for the trigger.

Tasks Completed

  • [x] Test (green when checked)

Tasks To Do

  • [ ] Test (red when not completed)

Changelog

1.2.3

  • Improved: Enhanced conditional enqueue logic for better performance on pages with multiple popup types
  • Fixed: Minor CSS improvements for popup modal positioning
  • Improved: Conditional enqueue for scripts and styles only on pages where popup shortcode, block, or global popup is present for better frontend performance.

1.2.1

  • Fixed video loading issues in popups
  • Added accessibility improvements (ARIA, screen reader support)
  • Updated button styles to use theme.json definitions

License

GPL v2 or later

Tested up to

6.6

Stable tag

1.2.3

  • = 1.2.3 =
  • * Improved: Enhanced conditional enqueue logic for better performance on pages with multiple popup types
  • * Fixed: Minor CSS improvements for popup modal positioning
  • * Improved: Conditional enqueue for scripts and styles only on pages where popup shortcode, block, or global popup is present for better frontend performance.
  • = 1.2.3 =
  • * Improved: Enhanced conditional enqueue logic for better performance on pages with multiple popup types
  • * Fixed: Minor CSS improvements for popup modal positioning
  • = 1.2.1 =