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 three steps to adding any custom field: Create, Display, Update.
Start a support ticket if you have any questions or need help.
Create the Field
We need to add a star rating field to our custom fields.
In wp-admin, go to Testimonials > Fields. 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 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.
Add the Field to the View
After creating 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.
- In the "Before" input, add any text you want to appear before the stars.
- 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.
Update Existing Testimonials
You may want to add a rating to testimonials you already have.
Edit the testimonial. In the Client Details meta box, you should see your star rating field.
- Click "Edit"
- Click a star
- Click "OK"
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 in the list.