- This topic has 4 replies, 4 voices, and was last updated 10 years, 2 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘WTI Like Post PRO’ is closed to new topics and replies.
Home › Forums › WTI Like Post PRO › Text next to image if has votes
Tagged: hook, wti_like_post_load_message
How to show a text next to the “thumb up” icon if the post has votes. At this moment there is no text if votes are present.
You can achieve this by using the filter hook wti_like_post_load_message
available for this message. You can check if the current message is not the default or thank you message, then you can show your message. Please refer to the manual for implementation.
Hello,
how do I exacty use this hook?
Please some help here.
Or better, make it change able in the plugins settings 🙂
Cheers
Denis
Can I get some suggestion to this please? I dont understand that
You can check if the current message is not the default or thank you message, then you can show your message
How do I check this?
Can someone help, please,
Denis
That hook is slightly modified. You can use the following piece of code. You can see it will show different messages if it has 1 vote and more than 1 votes. In case there are no votes, it will simply show the default message.
add_filter( 'wti_like_post_load_message', 'wti_like_post_load_message', 10, 4 );
function wti_like_post_load_message( $post_id, $like_count, $unlike_count, $msg ) {
if ( $like_count == 1 ) {
$msg = 'What about you, do you like the image?';
} else if ( $like_count > 1 ) {
$msg = 'Users already like this image.';
}
return $msg;
}
Thanks