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/):

  1. Create a folder "wppr" under the child theme (e.g. twentynineteen-child/wppr)
  2. 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
  3. 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;
    }
    	
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us