I am trying to: display a View of posts that have been favorited using WP Favorites plugin
I visited this URL: https://toolset.com/forums/topic/create-a-query-filter-in-a-view-to-filter-on-wp-favorite-posts/
I expected to see: a solution
Instead, I got: almost a solution
I have installed this plugin (favoriteposts.com) and it works well. The only challenge is I am trying to display a View of all favorited posts.
In my View, I see you can filter by the custom field 'simplefavorites_count'. I tried this and set the string to constant '1' and it was working for a little while. But it's not anymore.
I wonder if there's a better way. I saw this post (https://toolset.com/forums/topic/create-a-query-filter-in-a-view-to-filter-on-wp-favorite-posts/) where you suggested adding a wpv_filter_query
to functions.php
I tried using the code supplied in that support thread, but I imagine it needs to be edited, cause it's not working.
Any suggestions?
Thanks!
I don't know what that Plugin does exactly, but according to your description, it adds a simple Custom Field to Posts and updates this Post Field with the amount of "favourite", means, as many times some users click it as the favorite, this number is updated.
Is that correct?
Then you can not filter the View by "simplefavorites_count" equal "1" because of course, this value would increase each time the post is favourited.
What you could actually do is compare it to "not equal (empty)" or "not equal 0".
Can you check what value exactly is stored for a post in the field "simplefavorites_count"?
Can you also check what happens when 2 users favourite the same post?
Then we can come up with a solution.