The files in this download folder enable you to add a star rating system with schema for restaurant reviews. This enables you to add the rating stars after the entry title on single posts and archive pages including the category and home/front page archive.
Based on extensive use of Googles Structured Data Testing Tool, this schema is 100% valid and without error unlike many reviews i tested using URL’s from Trip Advisor, Facebook and other major sites offering user submitted reviews.
The values for each property are added using ACF otherwise, you can use the standard Custom Fields native to WordPress or uninstall the ACF plugin after adding your Microdata.
Note : Search engines like Google won’t display review rich results anymore for the schema types in cases where the entity being reviewed controls the reviews themselves.
Demo Video #
Shows how to add custom micro data for restaurant schema on single post reviews which also displays on archive pages.
Tested using the Genesis Sample & Magazine Pro child themes by StudioPress however will work in any Genesis child theme.
Included in the download folder you’ll find :
- A custom single post template which only loads on single posts assigned to the Reviews category.
- A custom function to generate the star rating system which can be output on any page/post type on your site.
- Custom functions to modify the default post info on single posts and archive entries.
- A custom, category template for the reviews category which loads the stars in the entry header for each entry in the archive. The template also includes code to modify to featured image, image alignment and excerpt/content.
- A custom home template to display the stars on your front page when using the front page to display your latest posts.
There’s 5 steps :
# Step 1 – Upload the files named category-reviews.php, home.php and single-post-reviews.php to your child theme folder.
# Step 2 – Copy & paste the PHP code from the functions.php file to the end of your child themes functions file.
# Step 3 – Install ACF plugin ( Free or Premium version ), go to Custom Fields > Import > and import the acf.json file like this :
# Step 4 – Create a new category named Reviews. The category slug must be reviews.
# Step 5 – Copy & paste the following CSS to the end of your child themes style.css file and clear caching.