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?
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/
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.
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"
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.
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"
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?
You can feedback if there is any plugin functionality problem.
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?
You don't need to convert the existing plugin field, in your screenshot,
enlace oculto
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