Home Forums WTI Like Post PRO Text next to image if has votes

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #107
    electroschematics
    Participant

    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.

    #108
    Webtechideas
    Keymaster

    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.

    #188
    DenisCGN
    Participant

    Hello,
    how do I exacty use this hook?
    Please some help here.
    Or better, make it change able in the plugins settings 🙂
    Cheers
    Denis

    #220
    DenisCGN
    Participant

    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

    #225
    Webtechideas
    Keymaster

    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

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