Adding Games Widget to Your WordPress Site
Last updated
Last updated
Looking to embed the Playgama games on your WordPress site? Whether you want it on all pages or just one, this guide walks you through the exact steps to add the Playgama widget using functions.php
. No plugins needed β just clean, native WordPress code!
To get your own Widget ID (e.g., WA0000000000000
), follow these steps:
Log in to your .
Create a new widget in your dashboard.
Once it's created, check the embed code β your unique widget_id
will be included there.
If your widget is already created, go to its page and click the </> button to view the embed code.
functions.php
FileUsing FTP or your hosting file manager, navigate to:
Replace <THEME_NAME>
with your active theme's folder name.
Paste this code inside the functions.php
file to enqueue the Playgama JavaScript SDK:
This ensures the Playgama script is loaded efficiently on the frontend of your site.
Add this snippet to functions.php
if you would like to initialize the widget on every page:
π Don't forget to replace widget_id
with your own Widget ID!
Next, add this HTML code wherever you want the widget to appear on your site:
If you only want the widget on selected pages (like your homepage, contact page, or a landing page), you may embed the initialization script directly where the widget should appear. See the next step.
Wherever you want the Playgama widget to appear, add this HTML snippet:
Place it in your page content (using a custom HTML block) or directly inside your template file (e.g., data/html/wp-content/themes/<THEME_NAME>/templates/page.html
).
β
Be sure to use your own widget_id
instead of the example!
You can change the width
and height
values in the style
attribute to adjust the widget size.
The widget is fully responsive, but for the basic version with 3 games, we recommend a size of 510Γ180 pixels to ensure a clean, balanced look on both desktop and mobile.
Max game height is 320 px.
It works with any custom or child theme
Script is loaded asynchronously to avoid slowing down your site
No need for third-party plugins
Clean and SEO-friendly integration