And The Winner Is...
How can I display the winner publicly (2 posts)

  1. DesignByAnita
    Posted 3 years ago #

    I've tested the plugin and it's working on the admin side, yay, thank you! :)

    Is there a way that the winner can be automatically notified or better still that the winner announced automatically via a widget within the blog post for the purpose of contest transparency?

    I'm part of a fairly tight hobby community and would like to be able to reassure customers and followers that there's no shenanigans. :)


  2. Angelica Costa
    Posted 3 years ago #

    Hi, DesignByAnita, here is what I did:

    $idcoment = get_post_meta(get_the_id(), '_and_the_winner_is', true);
    if($idcoment) {
    echo 'This giveaway/contest is finished and the winner was: <a href="#comment-'.$idcoment.'">'.get_comment_author($idcoment).'</a>';

    I pasted the code above right before <?php the_content(); ?> tag in my single.php page.

    Hope it helps.
    Here is a workign example from my blog: http://cupcakes.blog.br/geral/sorteio-de-um-dominio-e-hospedagem-por-um-ano/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • And The Winner Is...
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.