How to add a Review Widget to your WordPress site (default editor)
Learn how to embed reviews to WordPress with Trustmary Starter, Business & Scale
Santeri
Last Update ένας χρόνος πριν
Introduction
This article will instruct you on how to embed Trustmary's testimonials and surveys to your site when using WordPress' default theme and editor. If you're looking for instructions on the same subject, but for a different WordPress editor, please refer to the main article covering the integrations of Trustmary and WordPress.
Installing with the Trustmary plugin
The easiest way to embed widgets to your WordPress site is to use our official WordPress plugin. The plugin works seamlessly with all WordPress themes and editors.
Check out our guide on installing and using the plugin!
Installing with the code snippets
Start by navigating to the Widgets section in Trustmary. In there, select a widget or create a new one.
Once in the widget editor, select the Add to website tab at the top of the screen. Here you'll find the code snippets needed to embed the widgets; Trustmary Tag for loading the widgets, and Embed code for where to load the widget in question.
What to do with the snippets?
Note, that the two snippets of code serve different purposes.
The first snippet, Trustmary tag, is a global script which enables the loading of the widgets. This script needs to be installed once, either with Google Tag Manager or inside the <head> tag of a website. We recommend installing the script with Tag Manager, as scripts installed like this are activated more reliably. For the installation process, check out this guide.
The second snippet is the embed code itself. This snippet loads a widget into where it is placed on the site.
Embedding the code in WordPress
Optional: Add the header script manually
If you already installed Trustmary tag with Google Tag Manager, you don't need to worry about this step.
The most simple way of manually installing the widget script onto your WordPress site, is through the WPCode plugin. For instructions on how to install plugins, see the video below.
After the plugin is installed, simply paste the Trustmary tag you've retrieved from the app into the Header text box in the plugin settings and click Save changes.
Embedding the widget
Once you have the code, you're ready to embed it into your WordPress page. Start by opening up your dashboard in WordPress and navigating to Pages. Here you can either add a completely new page by clicking Add New, or edit an existing page by selecting one.
This opens up the page editor. In here, type a slash (the "/" -symbol) in the body section of the page (under the title) and the block menu opens up. Choose Custom HTML as the block type.
After creating the Custom HTML block, the embed code can be pasted into the text box inside the block. To verify the widget is functioning correctly, click either the Preview button or the Publish button in the top right corner.
After checking that the widget loads properly, you're all set!