How to change the directory for WPPR templates
This is how you can change the directory for WPPR templates directory (which by default is in /includes/public/layouts/):
- Create a folder "wppr" under the child theme (e.g. twentynineteen-child/wppr)
- Copy the PHP files and the PNG files for the templates under this folder (e.g. twentynineteen-child/wppr/custom-style.php and twentynineteen-child/wppr/custom-style.png)
If you want to copy the default icons you can find them here: wp-content\plugins\wp-product-review\assets\img\templates - Add this snippet to the functions.php file of your theme or your child theme where you'll add just the name of the PHP template files, without the ".php" extension:
add_filter( 'wppr_templates_dir', 'custom_wppr_templates_dir', 10, 1 ); function custom_wppr_templates_dir( $paths ){ $paths[] = 'twentynineteen-child/wppr'; return $paths; } add_filter( 'wppr_review_templates', 'wppr_review_templates', 10, 2 ); function wppr_review_templates( $templates ) { $templates[] = 'custom-style'; $templates[] = 'custom-style-1'; $templates[] = 'custom-style-2'; return $templates; }