Set Custom Preview Template Path

Set the path to a custom template with which your forms should be displayed when using Live Preview.

Code

Filename: gplp-preview-template.php

<?php
/**
 * Gravity Perks // Live Preview // Set Custom Preview Template Path
 * https://gravitywiz.com/documentation/gravity-forms-live-preview/
 *
 * Set the path to a custom template with which your forms should be displayed when using Live Preview.
 */
add_filter( 'gplp_preview_template', function( $template ) {
	return get_stylesheet_directory() . '/custom-template.php';
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.