Home Forums WTI Like Post PRO Show the word "votes" after the total votes and add thousands separator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #380


    I purchased this great plugin some days ago, works fine but I want to show a word after the like number, if the post has 1500 likes then show “1500 votes”, I added the word “votes” in this line:

    $wti_like_post .= “<span class=’lc-“.$post_id.” lc’>” . $like_count . ” votes</span></div>”;

    file wti-like-post-site.php, works when you visit the page for the first time, but if you press the button (or text) for voting, then the word “votes” disappears.

    Also, the same problem with de number format, I want tho show a thousands separator, 1,500 instead 1500.

    I put this: $result = number_format((float)$like_count , 0, ‘.’, ‘,’);

    Again, works fine when you visit the page for the first time, but when press the like button, the format dissapears. I think this is very easy for you, my programming skilss are weak as you can see.

    Sorry for my English.

    Thank for you help!



    The changes are lost because the content is loaded from ajax call where you have not added the necessary changes. You can modify the javascript code dealing with this ajax call. Please open wti-like-post.js file present inside ‘js’ folder using any text editor. There you need to change the following lines

    jQuery(".lc-" + post_id).html(response.like);
    jQuery(".unlc-" + post_id).html(response.unlike);


    jQuery(".lc-" + post_id).html(response.like + ' votes');
    jQuery(".unlc-" + post_id).html(response.unlike + ' votes');

    As you can see, we have concatenated the term ‘votes’ to the like and unlike count. You can also apply the thousands separator to the response above. Please refer here. Do let us know if this helped or not.



    Thank you!, it works.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WTI Like Post PRO’ is closed to new topics and replies.