Skip Navigation

[Résolu] Continued : Implement star rating for posts, Get average rating and add filter

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

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Marqué : ,

Ce sujet contient 10 réponses, a 2 voix.

Dernière mise à jour par marcB-6 Il y a 6 années et 11 mois.

Assisté par: Luo Yang.

Auteur
Publications
#598298
Screenshot_7.png

With reference to : https://toolset.com/forums/topic/ref-implement-star-rating-for-posts-get-average-rating-and-add-filter/

As suggested by you Minesh here : https://toolset.com/forums/topic/ref-implement-star-rating-for-posts-get-average-rating-and-add-filter/#post-595518

I have mentioned earlier I am using plugin : https://wordpress.org/plugins/wp-postratings/ & saving average in custom filed but When I am trying to add filter for it I can not see that field when I click on "New Filter".

Can you please help me to add star rating filter using custom field?

#598751

Dear Marc,

As you can see, in the thread you mentioned above:
https://toolset.com/forums/topic/searching-book-review-child-cpt-and-book-parent-cpt-by-star-ratings/#post-406289
Geoffrey is using custom JS & CSS codes to style the rating field.
According to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/

For the plugin "wp-postratings" you are using, there isn't such a built-in feature to integrate this plugin with Views plugin yet, if you agree, we can take it as a feature request.

Currently, I suggest you try to check it with the author of plugin "wp-postratings", ask if it is possible to save the average rating into a custom number field of post, then you will be able to setup the filter by custom field in the Views plugin:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
and setup the custom search form insider the view:
https://toolset.com/documentation/user-guides/front-page-filters/

#598872
Screenshot_1.png

Hi Luo
I am saving value of average rating from plugin in custom field "wpcf-ratings-average" using add_post_meta and I have tried adding filter.see attached screenshot.

But it is not allowing to add filter using radio button.

#599121

I assume you are going to add radio input into Views search form, please check the document I mentioned above:
https://toolset.com/documentation/user-guides/front-page-filters/#vfmh-adding-search-controls
Section "2.2. Adding inputs to the search form"

#599140

Can you check the screenshot I have provided in my first post?
In that you can see I am following the steps given here : https://toolset.com/documentation/user-guides/front-page-filters/#vfmh-adding-search-controls
But the problem is, As I have added filed using add_post_meta I can not see it in "Insert custom search filter" window.
How can I add filter for that field If I can not see it in "Insert custom search filter" window.

#599199

Haven't you setup the custom field "ratings-average" with Types plugin?
If you have not, please follow our document to control the field "wpcf-ratings-average" with Types plugin:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/
section "Converting custom fields"

#599222

Hi Luo,

Thanks for the article.I have a question..If I covert plugin's aeverage rating field to types field, Would it create any problem with plugin functionality?

#599691

You can feedback if there is any plugin functionality problem.

#599697

Thanks, But my question is instead of adding extra meta for saving average suing prefix "wpcf", Could I convert the existing plugin field which is saving average?

If yes, Would it create any problem in plugin's default functionality?

#599793

You don't need to convert the existing plugin field, in your screenshot,
lien caché
click button "New filter", click button "Load non-Types custom fields", find the field which is saving average, and setup the shortcode [wpv-control-postmeta] according to our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-postmeta

#600087

Okay Thanks a lot Luo!!