Title: Call voting over PHP Code
Last modified: August 22, 2016

---

# Call voting over PHP Code

 *  Resolved [andyleery](https://wordpress.org/support/users/andyleery/)
 * (@andyleery)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/call-voting-over-php-code/)
 * Hello.
 * I would like to display the current voting of yop poll on my homepage. Therefore
   I need a code like this (wp polls):
 * <?php if (function_exists(‘vote_poll’) && !in_pollarchive()): ?>
 * <?php get_poll(25);?>
 *  <?php display_polls_archive_link(); ?>
 * <?php endif; ?>
 * I couldnt find any php code, only the standard [xxx] variables.
    Can somebody
   please help me with this?
 * Thank you!
 * [https://wordpress.org/plugins/yop-poll/](https://wordpress.org/plugins/yop-poll/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [andyleery](https://wordpress.org/support/users/andyleery/)
 * (@andyleery)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/call-voting-over-php-code/#post-5426339)
 * I finally found it:
 * <?php return_yop_poll( -1 ); ?> – will display current poll
    <?php return_yop_poll(-
   2 ); ?> – will display last poll <?php return_yop_poll( -3 ); ?> – will display
   a random poll from your poll list

Viewing 1 replies (of 1 total)

The topic ‘Call voting over PHP Code’ is closed to new replies.

 * ![](https://ps.w.org/yop-poll/assets/icon-256x256.png?rev=3524390)
 * [YOP Poll](https://wordpress.org/plugins/yop-poll/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yop-poll/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yop-poll/)
 * [Active Topics](https://wordpress.org/support/plugin/yop-poll/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yop-poll/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yop-poll/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [andyleery](https://wordpress.org/support/users/andyleery/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/call-voting-over-php-code/#post-5426339)
 * Status: resolved