On WordPress the slot goes in a Custom HTML block and the script goes in once for the whole site. Doing the two separately avoids the problem that catches most people: WordPress removing a script tag from post content.
Before you start
WordPress filters what can be saved in content. Users who have the unfiltered_html capability can save scripts; users who don't have their scripts removed when the post is saved. On a typical single-site install, administrators have it. On a multisite network, usually only super administrators do. If you paste the snippet into a block and the script is gone after saving, that's why, and the steps below avoid it.
Step 1: add the slot
- Edit the post or page where the card should appear.
- Add a block and choose Custom HTML.
- Paste only the slot, not the script:
<div data-appadswap="SITE_ID" data-format="card"></div>
For a sidebar or footer, add a Custom HTML block or widget in Appearance → Widgets, or in the Site Editor if your theme is a block theme, and paste the same line there.
Step 2: load the script once
The script has to be on every page that has a slot. The simplest way that doesn't depend on the content filter is a plugin that adds code to the site's header or footer, such as the free Header and Footer Scripts plugin. Paste this into its footer box:
<script src="https://appadswap.com/w.js" async></script>
If your theme has its own "footer scripts" setting, you can use that instead. A child theme's footer.php works too, with the script just before the closing </body> tag; edit a child theme, not the parent, so a theme update doesn't remove it.
Step 3: check it works
Open the published page, not the editor preview. Then open the Sites page in your dashboard: it flips from unverified to live on its own once the widget has loaded.
If it doesn't work
- The card is missing and the script is in the post. A caching plugin may be serving an old copy of the page. Clear the cache and reload.
- The script is gone after saving. Your user lacks
unfiltered_html. Load the script through the plugin in step 2, which doesn't go through the content filter. - A security or optimisation plugin delays or removes scripts. Some of them defer third-party scripts until the visitor interacts. Look for an exclusion list and add
appadswap.com. - You're on WordPress.com rather than a self-hosted site. WordPress.com limits custom scripts and plugins depending on your plan. We haven't tested the widget there, so check what your plan allows.
Source
WordPress's own description of the Custom HTML block covers what the block accepts. Next: other install guides, or add your app.