Strong Testimonials makes it easy to add star ratings to your form and testimonials.
Star rating is a custom field type available in the fields editor. If you have not tried the fields editor yet, you may want to go through this complete example of customizing the form first to get acquainted.
There are 3 steps to adding any custom field: Add, Display, Update.
Add the field
We need to add a star rating field to our custom fields.
Go to wp-admin Testimonials Fields and click Add New Field.
In the Type dropdown, select “star rating”.
Change the label to make it easier to identify this field on the form, in the testimonial editor, and in the view editor. If you don’t want the label to appear on the form, uncheck “Show this label on the form”. You can also add text before and after the field on the form.
The label can be a word, like “Rating”, or a phrase, like “How do you rate our service?”
Change the name from the default “new_field” to something short and simple like “rating” or “star_rating”. You will see that name later in the field dropdown in the view editor. Only lowercase letters, numbers, and underscores are allowed.
Pro Tip: Think ahead. The name identifies the field in the database and should not be changed once set. If you change the name after using it (even once), the plugin will not migrate the data to the new field name. However, you can change the label as often as you like.
Save your changes and your new field is now available on each testimonial and your form.
Display the field
After adding the star rating field, we need to display it.
Edit the view that you want to display the star rating. In the Custom Fields section, click Add Field.
In the Name dropdown, select your new rating field from the “custom” group.
- Add any text you want to appear before the stars in the “Before” option.
- Add any CSS class names if you plan to add custom style.
You can drag and drop those fields into a new order if you want.
Remember to save your changes.
Now you’re ready to accept and publish star ratings on new testimonials.
You may want to add a rating to the testimonials you already have.
Edit the testimonial. In the Client Details meta box, you should see your star rating field.
- Click a star
The rating is now saved; no need to click “Update”
If you checked Admin List when creating the field, the star rating will have its own column.