Skip to content

Widgets Guide

WB Polls includes two widgets for displaying poll results in sidebars and widget areas. Show real-time voting data with visual progress bars to keep your community engaged with active polls.

Widget Purpose Poll Type
(BuddyPress) Poll Graph Activity poll results BuddyPress Activity Polls
WB Poll Report Standalone poll results Standalone Polls

Poll Results Widget

Display results from BuddyPress activity polls with interactive progress bars and a poll selector dropdown.

  • BuddyPress must be active
  • User must be logged in to view the widget
  • At least one activity poll must exist
  1. Navigate to Appearance > Widgets
  2. Find “(BuddyPress) Poll Graph” in the available widgets
  3. Drag it to your preferred sidebar or widget area
  4. Configure the settings
  5. Click Save
Setting Description Default
Title Widget heading displayed above results “Poll Graph”
Max polls to show Number of polls in the dropdown selector (1-20) 5
Default poll Which poll loads when the widget first appears First available

Poll Selector: A dropdown menu showing available activity polls by title. The widget loads new results automatically when you change the selection.

For Each Poll Option: The option text, vote percentage, vote count, and an animated progress bar with color coding.

Additional Features: Total vote count at the bottom, CSV export button for administrators, and a loading spinner during AJAX updates.

The widget cycles through eight distinct colors for visual distinction: blue, green, amber, red, purple, pink, cyan, and lime.

User Type What They See
Logged-out visitors Widget is hidden
Regular users Their own polls and public polls
Administrators All activity polls

Administrators see an “Export CSV” button that downloads poll data including the poll question, all options with vote counts, voter information, and timestamps.

Display results from standalone polls with support for single poll or all-polls display modes.

  • At least one published standalone poll must exist
  • Works for all visitors including logged-out users
  1. Navigate to Appearance > Widgets
  2. Find “WB Poll Report” in the available widgets
  3. Drag it to your preferred sidebar or widget area
  4. Configure the settings
  5. Click Save
Setting Description Options
Title Widget heading Default: “Poll Results”
Display Type How polls are shown All Polls or Single Poll
Select Poll Which poll to display (single mode only) Dropdown of published polls

All Polls Mode (Default): Shows a dropdown with all polls that have received votes. Users can switch between polls, and results update dynamically via AJAX. Use this for sites with multiple active polls.

Single Poll Mode: Displays one specific poll without a dropdown selector. Best for focused campaigns or featured polls.

Each poll shows its title and total vote count at the top. For each option, the widget displays the option text, vote percentage, vote count, and a colored progress bar.

If no published polls exist, the widget shows “No polls found.” If a selected poll has no votes yet, it shows “No votes yet.”

Uses the same eight-color rotation as the Activity Poll Graph widget: blue, green, amber, red, purple, pink, cyan, and lime.

User Type What They See
Guest visitors Published poll results
Logged-in users Published poll results
Administrators Published poll results

WB Polls registers a custom sidebar called “WB Polls Sidebar” that appears on single poll pages and the poll archive. You can add widgets to this area to complement poll content.

Feature your most important poll on the homepage sidebar:

  1. Add the “WB Poll Report” widget
  2. Set Display Type to “Single Poll”
  3. Select your featured poll
  4. Set the title to “Vote Now!”

Show recent poll results alongside the BuddyPress activity stream:

  1. Add the “(BuddyPress) Poll Graph” widget
  2. Set Max polls to 3
  3. Set the title to “Recent Poll Results”
  4. Place in the activity page sidebar

Let users browse all active polls from the sidebar:

  1. Add the “WB Poll Report” widget
  2. Set Display Type to “All Polls”
  3. Set the title to “Community Polls”
Feature Activity Poll Graph WB Poll Report
Poll Type BuddyPress Activity Standalone
Login Required Yes No
Guest Access No Yes
Display Modes Single with dropdown Single or All Polls
Export Feature Yes (admin only) No
Max Polls Setting Yes (1-20) No
Real-time Updates Yes (AJAX) Yes (AJAX)

Both widgets use consistent CSS classes for customization:

.wb-poll-widget { } /* Widget container */
.wb-poll-widget select { } /* Poll selector dropdown */
.wb-poll-results { } /* Results container */
.wb-poll-option { } /* Individual option row */
.wb-poll-bar-container { } /* Progress bar container */
.wb-poll-bar { } /* Filled progress bar */
.wb-poll-votes { } /* Vote text (percentage and count) */

Override the default colors in your theme CSS:

.wb-poll-bar:nth-child(1) { background-color: #your-color; }
.wb-poll-bar:nth-child(2) { background-color: #your-color; }

Both widgets are fully responsive. Progress bars scale to the container width, text wraps appropriately, and the dropdown fills the available width on mobile devices.