Support » Plugin: Reaction Buttons » [Plugin: Reaction Buttons] Display reaction count

  • Resolved luispma


    Loving this plugin – it’s exactly what I have been looking for. I run a music blog and this is by far the easiest and best way to get readers’ reaction of songs/albums without waiting for a few people to comment.

    That’s kind of why I am posting on this forum. I want to be able to display “reaction count” on the post meta data section on the index and single pages. Instead of a “comment count”, I want there to be a “Reaction” count (i.e. “xx Reactions”). I hope it won’t be too difficult because I know the plugin keeps track of the number of clicks/reaction each post receives because of this stats page:

    Basically, I want the number in the parenthesis (pictured) on the post meta data section. Is this possible?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Jakob Lenfers


    I’ll release a version later this day with this feature. I’m just working on integrating some features I got a few weeks ago.

    Plugin Author Jakob Lenfers


    It’s in v1.1. reaction_buttons_click_count($post_id) returns the number of all clicks for the post with the $post_id.

    Wow, thank you very much! I’m not particularly good at even the simplest php editing. I added this to my theme:

    <span class="head"><?php _e('Reactions') ?></span>
                        			<span class="body"><?php reaction_buttons_click_count($post_id); ?></span>

    And the reaction click count is not showing up. What am i doing wrong?

    Plugin Author Jakob Lenfers


    Oh well, sorry, the function takes the post id as parameter. e.g.
    But usually you want it dynamic in your theme. While you are “in the loop” (you usually are while dealing with posts in the standard themes), the following will most likely work for you:
    <span class="body"><?php echo reaction_buttons_click_count(get_the_ID()); ?></span>

    Thank you! That works perfectly.

    wondering if there is a simple way to not display the vote count and just display “voted counted” instead.

    oh and use an image as the button?

    Plugin Author Jakob Lenfers


    No, there is no way to not show the reactions after someone clicked. You can use CSS to use an image as the buttons.

    well i got rid of the number [Vote(1)], and votes are being counted. the only other thing is i would need to make it popup and say “vote counted” like it does when you have already voted.

    for example AFTER the vote, show vote text like:

    $html .= " voted' href=\"javascript:alert('".htmlspecialchars('Already Voted')."');\">";

    or an after vote, redirect to custom link

    Plugin Author Jakob Lenfers


    There is no way atm to do that. You can add your own java script if you want to, you seem to have found the places. 🙂

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Reaction Buttons] Display reaction count’ is closed to new replies.