Poll Collector Wordpress Plugin
Run polls on your WordPress posts and pages, simply.
Poll Collector uses shortcodes. To create a poll, create a shortcode as directed below and paste it into your post or page.
- Install the plugin.
- Go to the plugin settings by visiting Settings > Poll Collector in your WordPress admin.
- Update the template html you would like rendered to your pages or posts. (The default templates will render nicely on sites using Bootstrap
- Change any settings you'd like.
- Visit the Builder page for help building a shortcode (or follow the guide below and create your own). The builder shows you how to define the poll answers, and whether a poll is open (visitors can vote) or closed.
- Copy the shortcode and paste it in your post or page. Then save your post or page.
- Visit your post or page, and you should see your poll!
About the plugin
Poll Collector is for running polls on your website.
Each poll is associated with a single post or page. They can be used with custom post types, too (since custom post types are just posts). Only one poll can be associated with each post.
Poll data is stored as post meta data using update_post_meta(). Each answer has a database record with the total count of votes. For example, if you're poll has two answers, "yes" and "no", the post meta data would have two records:
poll-answer-yes = 10 post-answer-no = 5
The shortcode is based off of [poll_collector]
The poll options. This might be a list of politicians, favorite colors, or just "yes" and "no".
[poll_collector answers="Bill Clinton, George W Bush, Barack Obama"]
Denotes whether visitors can vote in the poll or not. Voting is allowed, by default.
To close a poll, set the "clickable" attribute to "no", "false" or "0".
To open a poll, leave off this attribute, set this option without a value ("[poll_collector clickable]"), or set it to "yes", "true" or "1".
The ID of the post to associate with the poll. You shouldn't ever need this, unless you want to display a poll somewhere other than on the same page as its post.