WordPress
To integrate Preo Widget with WordPress, you can use the built-in Custom HTML block in the Gutenberg editor or register the SDK script via your theme's functions.php for site-wide availability.
Quick Start — Custom HTML Block
The simplest approach. No plugins or code changes required.
- Open or create a Page (or Post) in the WordPress Block Editor (Gutenberg)
- Add a Custom HTML block where you want the storefront to appear
- Paste the following code:
Code
- Replace
prod:eu:yourorg:edt_xxxxxwith your actual SDK ID - Publish or Update the page — the storefront widget will render on the frontend
This method loads the SDK script only on the page where the block is placed, which is ideal if you need the widget on a single page.
Site-wide Script Registration
If you plan to use the widget on multiple pages, it's better to register the SDK script globally via your theme so it is loaded once and cached by the browser.
Add the following to your theme's functions.php (or a child theme's functions.php):
Code
After registering the script, you only need the widget tag in your Custom HTML blocks — without the <script> tag:
Code
Shortcode
You can create a WordPress shortcode to make it easier for editors to embed the widget without writing HTML.
Add the following to your theme's functions.php:
Code
Then use the shortcode in any page or post:
Code
Or with additional options:
Code
You can extend the shortcode to support more attributes from the Options reference.
Page Template (Advanced)
For full control over layout and styling, create a dedicated page template in your theme.
- Create a file
page-preo-storefront.phpin your theme directory:
Code
- In the WordPress admin, create a new Page and select Preo Storefront from the Template dropdown in the page settings sidebar
Troubleshooting
Widget not rendering
- Verify the page is viewed on the frontend (not the editor preview). The Custom HTML block preview in Gutenberg may not execute scripts.
- Ensure no caching plugin is stripping or deferring the SDK script. If using a cache/optimization plugin (WP Rocket, Autoptimize, etc.), exclude
edge.preo.cloudfrom script optimization.
Widget appears unstyled or broken
- Check that your theme's CSS is not overriding the widget styles. The Preo widget uses Shadow DOM, but aggressive global styles like
* { all: unset; }can interfere. - Ensure the container element has sufficient width — the widget is responsive but needs at least ~320px.
Script blocked by security plugin
- If you use a Content Security Policy (CSP) or security plugin, allow
https://edge.preo.cloudas a script source.
For a full reference of available widget attributes, see the Options page.

