Skip Navigation

[Fermé] I am trying to display a View of favorite posts

This support ticket is created Il y a 7 années et 5 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Marqué : ,

This topic contains 1 réponse, has 2 voix.

Last updated by Beda Il y a 7 années et 5 mois.

Assisted by: Beda.

Auteur
Publications
#458419

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!

#458672

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.

Le sujet ‘[Fermé] I am trying to display a View of favorite posts’ est fermé à de nouvelles réponses.