Skip Navigation

[Resolved] Looking for plugin for "like"ing posts.

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by donC-3 4 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1585305

I want to add an option for logged in users to "like" posts. Then those likes would not only display the count on the post but also show up in a view or search (and be able to sort by them). Do you happen to know of a good plugin for this that you'd recommend. Since we're going to be using a lot of the toolset tools I thought it might be good to see if you had any experience or recommendations.

#1585755

Hi, I don't have a great recommendation on this but I can offer some technical advice. If you want to sort a View of posts using the number of "Likes" or "Favorites", the plugin you choose must store that number in a custom field associated with the post. Other solutions that store likes externally (like a Facebook widget) would not be sortable. The author of another plugin would be able to tell you whether or not their plugin works by incrementing/decrementing a standard postmeta field to manage "likes". If so, then you might have luck integrating it with Views sorting. A supporter here would be able to check the database and determine whether or not that custom field can be sorted upon.

Some third-party plugins use hidden custom fields. We have more information about sorting a View using hidden custom fields here: https://toolset.com/documentation/user-guides/custom-content/using-third-party-hidden-fields/

If you want to track individual Users' favorites, it's more complex because not only do you need to store the total number of likes in a custom field on the post, you must also figure out a way to store which User liked which post, and probably allow them a mechanism to dislike as well. That means storing the User ID in a repeating field on the post, or storing the post ID in a repeating field in the User Profile. A complex custom code solution to handle something similar is discussed in another ticket:
https://toolset.com/forums/topic/method-for-user-to-choose-post-as-favorite/

I'm happy to run a quick test with any plugin you decide to try. Feel free to search the forums for the name of any plugin you want to vet, it's possible other Users have posted here about their findings.

#1585789

Thanks Christian. I think I'm looking at possibly this one: https://wordpress.org/plugins/likebtn-like-button/

When I looked I found this which makes it seem like it's added in a meta field https://wordpress.org/support/topic/sort-posts-by-likes/ (when looking at the code).

I'm thinking I'm going to have a like button (so we can see which are most liked), and also a favorite (which would list items in their profile). That way they can choose which ones they want to follow/remember vs just saying they like it. And likes would be used for sorting where favorites/bookmarks is just for them personally.

Looking at hidden link for the favorites.

Going to go digging. If you get a chance to look, great, if not it's ok. Don't really consider it part of your job at that point (I'm a dev, just don't do a lot of WP).

#1586953

Thanks Christian. I think I'm looking at possibly this one: https://wordpress.org/plugins/likebtn-like-button/
I did a quick test and it's not looking good. There is a proprietary table added to the database to store likes, not a single postmeta value associated with a post. I think they may have changed how likes are stored since this post was created 2 years ago.

#1587051

Thanks. I may look at some others like https://wordpress.org/plugins/wp-ulike/ . I appreciate all the time you spent.

#1589331

My issue is resolved now. Thank you!