WordPress.org

Plugin Directory

wiki:wp-polls/usage

WP-Polls Usage Instructions

Open wp-content/themes/<YOUR THEME NAME>/sidebar.php

Add Anywhere:

<?php if (function_exists('vote_poll')): ?>
<li>
        <h2>Polls</h2>
        <ul>
                <?php get_poll();?>
                <li><a href="<?php echo get_settings('siteurl'); ?>/wp-content/plugins/polls/wp-polls.php">Polls Archive</a></li>
        </ul>
</li>
<?php endif; ?>

Note:

  • To show specific poll, use <?php get_poll(<ID>);?> where <ID> is your poll id.
  • To embed a specific poll in your post, use [poll=<ID>] where <ID> is your poll id.


To Display Total Polls

Use:

<?php if (function_exists('get_pollquestions')): ?>
        <?php get_pollquestions(); ?>
<?php endif; ?>


To Display Total Poll Answers

Use:

<?php if (function_exists('get_pollanswers')): ?>
        <?php get_pollanswers(); ?>
<?php endif; ?>


To Display Total Poll Votes

Use:

<?php if (function_exists('get_pollvotes')): ?>
        <?php get_pollvotes(); ?>
<?php endif; ?>



Back To WP-Polls Documentation

Last modified 12 years ago Last modified on 06/18/06 12:07:21