• When displaying a poll using either the shortcode or widget using the “currently active” option, how is it determined which poll will be displayed if multiple polls are currently active?

    I would like to set it up so that there is a primary poll that is always active (i.e. no end date), but if there is another active poll with a newer start date, that newer poll would be shown instead. This way, the poll widget will always display some kind of poll.

    Also, if there isn’t a currently active poll, is there a way to make the currently active widget/shortcode display some text like “There are currently no polls open for voting,” or default to displaying the results from the most recent poll?

    Thank you!
    John

    https://www.ads-software.com/plugins/yop-poll/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YOP

    (@yourownprogrammer)

    Hello

    “Currently active” is the poll that start date closest to current date.

    To add the text you want, you will need to edit public-admin.php under inc folder.

    Replace

    if( ! $yop_poll_model->ID ) {
    
                    return '';
    
                }

    with

    if( ! $yop_poll_model->ID ) {
    
                    return 'Your Text Here';
    
                }

    Best
    YOP Team

    Thread Starter joleksow

    (@joleksow)

    Thanks for the response! So if I have a poll that opens on Jan 1 and another that opens on Jan 5, and both are active, the “Currently active poll” widget will definitely display the one that opens on Jan 5?

    Regarding the code update you suggest, I’m concerned that the change would be overwritten when upgrading to a new version. Do you have any plans to add filters to the plugin that would allow for customization through my own functions.php, or adding an option to the widget for text to display if there are no currently active polls?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘"Currently active" when multiple polls are active’ is closed to new replies.