Skip Navigation

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

This support ticket is created Il y a 7 années. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

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

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

Assisté par: Minesh.

Auteur
Publications
#595514
Screenshot_1.png

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

I have added field using below code

add_post_meta($post_ID, 'wpcf-ratings-average', 0, true);
update_post_meta($post_id, 'wpcf-ratings-average', $post_ratings_average);

Now, How to add filter for star rating?

Thanks

#595518

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you should check with the following reply, how you can build star rating filer:
=> https://toolset.com/forums/topic/searching-book-review-child-cpt-and-book-parent-cpt-by-star-ratings/#post-406289

#595523

The link you suggested above is to create rating system manually..but you see in our last ticket you have suggested to create a toolset number field. So I have added field using add meta and I am asking you that how to add filter using that field.

I have added meta using wpcf- prefix in plugin file.

#595524

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I understand that but you can not enter filter using star images etc..etc..

You can enter normal filter either by dropdown with values or as radio buttons with values. To style the filter with star images you need to follow the link I shared with you.

I hope I make things clear here.

#596737

Thanks