我们正在使用一个定制的感谢页面,该页面旨在显示一个定制的小册子PDF,具体取决于将您发送到感谢页面的登录页面。
在登录页上,我们使用了一个重力表单,它有一个重定向查询字符串house={embed_post:ID}
:
这很好用。例如,从一个登录页,提交表单需要http://www.rossnorthhomes.com.au/thank-you/?house=3466
感谢页面模板为:
<?php
/**
* Template Name: Thank You Page (Custom Template)
*/
$house = $_POST[\'house\'];
$page_sidebar = get_post_meta( $post->ID, \'fave_page_sidebar\', true );
$page_background = get_post_meta( $post->ID, \'fave_page_background\', true );
if( $page_sidebar == \'none\' ) {
$content_area = \'col-lg-12 col-md-12 col-sm-12 col-xs-12\';
} else if( $page_sidebar == \'left_sidebar\' ) {
$content_area = \'col-lg-8 col-md-8 col-sm-12 col-xs-12 list-grid-area container-contentbar\';
} else if( $page_sidebar == \'right_sidebar\' ) {
$content_area = \'col-lg-8 col-md-8 col-sm-12 col-xs-12 container-contentbar\';
}
if( $page_background == \'none\' && $page_sidebar == \'none\' ) {
$page_bg = \'no-padding-bg\';
}
$sticky_sidebar = houzez_option(\'sticky_sidebar\');
$sidebar_meta = houzez_get_sidebar_meta($post->ID);
?>
<?php get_header(); ?>
<?php get_template_part( \'template-parts/page\', \'title\' ); ?>
<section class="section-detail-content houzez-page-template">
<div class="row">
<div class="<?php echo esc_attr( $content_area ); ?>">
<div class="page-main">
<div class="white-block <?php echo esc_attr( $page_bg ); ?>">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
get_template_part( \'content\', \'page\' );
// End the loop.
endwhile;
?>
<?php
switch ($house) {
case 429: /* The Katherine */
echo "<p>Download <a href=\'http://www.rossnorthhomes.com.au/wp-content/uploads/2017/09/The-Katherine-Display.pdf\'>property brochure</a>.</p>";
break;
case 3466: /* The Beaufort */
echo "<p>Download <a href=\'http://www.rossnorthhomes.com.au/wp-content/uploads/2017/09/The-Beaufort-Display.pdf\'>property brochure</a>.</p>";
break;
case 3481: /* The Merivale */
echo "<p>Download <a href=\'http://www.rossnorthhomes.com.au/wp-content/uploads/2017/09/The-Merivale-Display.pdf\'>property brochure</a>.</p>";
break;
}?>
</div>
</div>
</div>
<?php if( $page_sidebar != \'none\' ) { ?>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 container-sidebar <?php if( $sticky_sidebar[\'page_sidebar\'] != 0 ){ echo \'houzez_sticky\'; }?>">
<aside id="sidebar" class="sidebar-white">
<?php
if( $sidebar_meta[\'specific_sidebar\'] == \'yes\' ) {
if( is_active_sidebar( $sidebar_meta[\'selected_sidebar\'] ) ) {
dynamic_sidebar( $sidebar_meta[\'selected_sidebar\'] );
}
} else {
if( is_active_sidebar( \'page-sidebar\' ) ) {
dynamic_sidebar( \'page-sidebar\' );
}
}
?>
</aside>
</div>
<?php } ?>
</div>
</section>
<?php get_footer(); ?>
注:
$house = $_POST[\'house\'];
&;
<?php
switch ($house) {
case 3466: /* The Beaufort */
echo "<p>Download <a href=\'http://www.rossnorthhomes.com.au/wp-content/uploads/2017/09/The-Beaufort-Display.pdf\'>property brochure</a>.</p>";
你能理解为什么没有注入自定义内容吗?i、 e:
<p>Download <a href=\'http://www.rossnorthhomes.com.au/wp-content/uploads/2017/09/The-Beaufort-Display.pdf\'>property brochure</a>.</p>