PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Template Tag To Show Recent Polls

  1. I'm looking to create a div on my home page which will show the results of some of the most recent polls. I'm thinking I will show the 4 most recent poll results...not sure (depends on how I style it I guess to determine how much I can fit in the space designated for the div). I'm looking for something like this..

    <?php echo get_gf_polls_recent($results ->(4)) ?>

    or something to that effect. Is this doable? If so, what would the template tags be? Thanks in advance. Great plugin add-on by the way...I love it!

    Posted 5 years ago on Friday May 24, 2013 | Permalink
  2. Looks like this is the function you want (from polls.php):

    // returns the results in an array of HTML formatted data
    public static function gpoll_get_results($formid, $display_field = "0" /* zero = all fields */, $style = "green", $show_percentages = true, $show_counts = true, $lead = array()) {

    You would call it like this in your template file, with the appropriate arguments:

    $results = GFPolls::gpoll_get_results( arguments ...);
    Posted 5 years ago on Sunday May 26, 2013 | Permalink
  3. Thank you Chris. Hope you had a great Memorial Weekend!

    Posted 5 years ago on Tuesday May 28, 2013 | Permalink