Manually embed PollPolly Web Widget in WordPress

To integrate the PollPolly Web Widget into a WordPress site for all posts, you can follow the steps below:

Step 1: Access the WordPress dashboard

Log in to your WordPress dashboard.

Step 2: Paste the code into functions.php

  1. Go to Design > Theme Editor.
  2. Select the functions.php file of your active theme.
  3. Add the following code to the end of the file to insert the widget into all posts:
function add_pollpolly_widget($content) {
    if (is_single()) {
        ob_start();
        ?>
        <div id="pollpolly-widget"></div>
        <script src="https://app.pollpolly.com/static/widget/widget.js" crossorigin="anonymous"></script>
        <?php
        $widget_content = ob_get_clean();
        return $content . $widget_content;
    }
    return $content;
}
add_filter('the_content', 'add_pollpolly_widget');

Step 3: Save changes

Click on Update file to save the changes.

Step 4: Checking the posts

Go to one of your posts on the website and check that the PollPolly Web Widget is displayed correctly. With these steps, the PollPolly Web Widget will be displayed in all your WordPress posts.