WordPress.org

Support

Support » Plugins and Hacks » Reaction Buttons » [Resolved] [Plugin: Reaction Buttons] Display reaction count

[Resolved] [Plugin: Reaction Buttons] Display reaction count

  • 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: http://i54.tinypic.com/219v3p0.png

    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

    @jakob42

    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

    @jakob42

    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

    @jakob42

    Oh well, sorry, the function takes the post id as parameter. e.g.
    reaction_buttons_click_count(33);
    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

    @jakob42

    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

    @jakob42

    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 ‘[Resolved] [Plugin: Reaction Buttons] Display reaction count’ is closed to new replies.
Skip to toolbar