• Resolved Chris Gagner

    (@chrisgagner)


    Hello,

    I am only using the thumbs up button (I have changed the CSS of thumbs down to display:none). I want to display the number of thumbs up at the top of the page next to comments. For example: 5 comments – 8 likes. What function would I need to call in order to display that number (the number 8 in example)?

    http://wordpress.org/plugins/thumbs-rating/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ricard Torres

    (@quicoto)

    Hi chrisgagner,

    First of all, thanks for using the plugin!

    Here’s the snippet to print the number of up votes. You should paste it inside the loop (near the comments should be fine):

    <?php $thumbs_rating_up_votes = get_post_meta(get_the_ID(), '_thumbs_rating_up'); print_r($thumbs_rating_up_votes[0]); ?>

    Let me know if this works for you,

    Cheers.

    Ricard

    Thread Starter Chris Gagner

    (@chrisgagner)

    The code works if the number of votes is greater than 0. However, when it’s 0, it returns nothing.

    Is there a way to make it so that it can display a 0 when there are no votes?

    Plugin Author Ricard Torres

    (@quicoto)

    Alright chrisgagner, don’t worry.

    I’ll create a new function in the plugin to print the value (0 or any).

    I’ll let you know.

    Thread Starter Chris Gagner

    (@chrisgagner)

    Thanks for all your help!

    This is an excellent plugin.

    Plugin Author Ricard Torres

    (@quicoto)

    Hey chrisgagner,

    I’ve pushed a new update (1.4) with two new functions to print the values.

    After updating, you can find them here:

    http://wordpress.org/plugins/thumbs-rating/faq/

    Let me know.

    Cheers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Thumbs Up Counter’ is closed to new replies.