Create a shortcode for custom page template
Adding the following code into your theme's "function.php" file:
function my_form_shortcode() {
ob_start();
get_template_part('page-pack-unpack-quote');
$content = ob_get_clean();
return $content;
}
add_shortcode('my_form_shortcode', 'my_form_shortcode');
Here, 'page-pack-unpack-quote' is your template file name.
In page editor write : [my_form_shortcode]
function my_form_shortcode() {
ob_start();
get_template_part('page-pack-unpack-quote');
$content = ob_get_clean();
return $content;
}
add_shortcode('my_form_shortcode', 'my_form_shortcode');
Here, 'page-pack-unpack-quote' is your template file name.
In page editor write : [my_form_shortcode]
Comments
Post a Comment