• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Disable unlike

Hi, I need to disable the option to "unlike" posts.
So after a user click in "Like", the user cant click again the button to "Unlike" that post.

I need the Like button enabled, but Unlike disabled.

Is there any way to do this please?

Any help will be appreciated.



Well-known member
Try playing around with the following codes.

Template: post

                <xen:if is="{$post.canLike}">
                    <a href="{xen:link posts/like, $post}" class="LikeLink item control {xen:if $post.like_date, unlike, like}" data-container="#likes-post-{$post.post_id}"><span></span><span class="LikeLabel">{xen:if $post.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
Template: profile_post

                    <xen:if is="{$profilePost.canLike}">
                        <a href="{xen:link 'profile-posts/like', $profilePost}" class="LikeLink item control {xen:if $profilePost.like_date, unlike, like}" data-container="#likes-wp-{$profilePost.profile_post_id}"><span></span><span class="LikeLabel">{xen:if $profilePost.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
Template: profile_post_comment

                    <xen:if is="{$comment.canLike}">
                        <a href="{xen:link 'profile-posts/comments/like', $comment}" class="LikeLink item control {xen:if $comment.like_date, unlike, like}" data-container="#likes-pc-{$comment.profile_post_comment_id}"><span></span><span class="LikeLabel">{xen:if $comment.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>