WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
Conditional display of poll (2 posts)

  1. rrjmdpa
    Member
    Posted 1 year ago #

    I've been using wp-poll for awhile and need to change due to lack of needed functionality. I can't find in your support documents how to conditionally add a poll for example to the single.php file.

    Under my old wp-poll system it was simply to:

    <?php if (function_exists('vote_poll') && !in_pollarchive()): ?>
          <div class="module module-poll">
            <!-- <?php get_poll();?> old wp-poll code -->
          </div>
          <!-- /.module -->
    <?php endif; ?>

    I need the YOP equivalent for the "function exists" and the "not in archive" logic - i.e. in case the plug-in isn't functioning or is deactivated or is on the poll archive page; and,

    I need the php equivalent command to insert the poll html code. I don't always have an active poll and want it to display the results of the old poll until a new one is posted.

    I haven't yet looked at the css styling but I use .button classes etc so I've got to figure out where to find those templates.

    Can anyone help?

    http://wordpress.org/extend/plugins/yop-poll/

  2. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hello

    You can use the code below

    <?php echo do_shortcode('[yop_poll id="-1"]'); ?>

    Please let us know if this is what you are looking for.

    Best Regards,
    YOP Team

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic