WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
[resolved] YOP Polls and Widget Logic (2 posts)

  1. dhogwood
    Member
    Posted 1 year ago #

    Currently using YOP Polls as a widget however I'm looking for the widget to effectively disappear once the user has voted.

    I also have a separate plugin 'Widget Logic' installed which allows me to call php conditional tags, for instance if I called '!is_user_logged_in()' the widget would only show when the user is not logged in.

    Can you please point me towards the appropriate code to tell if a user has voted in a specific poll?

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

  2. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    From the main menu go to "Templates" and edit the template you used for your poll.

    Delete all the code in "Template Before Vote" and "Template After Vote" section, replace it with

    <script>
    jQuery('#yop-poll-container-%POLL-ID%').parent().hide();
    </script>

    and save.

    Then edit your poll and in "Other Options" section, at "Blocking Voters:" choose "By Cookie" or "By Ip" or "By Cookie & Ip" and save the changes.

    Best wishes,

    YOP Team

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic