WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
[resolved] How does the if (function_exists('yop_poll')) work? (3 posts)

  1. Alkorr
    Member
    Posted 10 months ago #

    Hi, I would like to add this function in my index.php but I don't know if your plugin supports it, and how to show a specific poll.

    My try is not conclusive, I'm afraid:

    <?php if (function_exists('yop_poll')): ?>
    <?php get_yop_poll(1);
    
    <em>[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]</em>
    ?>
    <?php endif; ?>

    Thanks for your help!

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

  2. YOP
    Member
    Plugin Author

    Posted 10 months ago #

    Hi Alkorr,

    The function you are looking for is return_yop_poll( $poll_id ) so you can add the code below to your index.php file:

    <?php if (function_exists('return_yop_poll')): ?>
    <?php return_yop_poll(1); ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]
    <?php endif; ?>

    Here you can replace $poll_id :

    A. with the ID of the poll you want to display
    B. with -1 to display the Current Active Poll ID
    C. with -2 to display the Latest Poll
    D. with -3 to display a Random Poll

    Hope this helps.

    Best wishes,

    YOP Team

  3. Alkorr
    Member
    Posted 10 months ago #

    Fantastic, exactly what I wanted, thanks! :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.