簡體   English   中英

聯系表格 7 在 Bootstrap 模式中不起作用

[英]Contact Form 7 Not Working Inside Bootstrap Modal

已經為此苦苦掙扎了幾個小時,非常感謝任何幫助。

我正在使用 WordPress,帶有我創建的自定義主題和 Contact Form 7 插件。

我正在嘗試創建一個登錄頁面,用戶單擊第一個按鈕,被帶到模態框內的表單,並在成功完成表單后被定向到下載鏈接。

當表單在模式之外或在不同的頁面上時,表單本身可以完美地工作。

但是在模態框內,表單在完成后無法將用戶重定向到 PDF 文件。

提交后,模式關閉,頁面刷新鏈接http://example.com/landing/#wpcf7-f188-o1而不是轉到 PDF 文件。

我覺得它可以用 JS 修復,但我從來沒有涉足過它,甚至不知道要調查哪個文件,或者坦率地說從哪里開始。

感謝您提前提供任何幫助。

PS。 這是現場網站的鏈接:http: //goo.gl/XBaOs3

    <div class="vertical-center">
        <div class="container">
            <div class="row text-center">
                <div class ="col-md-offset-3 col-md-6 opt-modal cta-container-center">
                    <h1 class="headline">7 Must-Have Tools for Real Estate Companies</h1></br>
                    <button type="button" class="btn btn-primary btn-lg btn-block cta-link" data-toggle="modal" data-target="#myModal">Download Now</button>
                    <!-- Modal -->
                    <div id="myModal" class="modal modal-vcenter fade" role="dialog">
                        <div class="modal-dialog">  
                            <!-- Modal content-->
                            <div class="modal-content">
                                <div class="modal-header">
                                    <img class="modal-header-image" src="http://beltadigital.com/wp-content/uploads/2015/10/leadbox-header-image-placeholder.png">
                                </div>
                                <div class="modal-body">
                                    <div class="landing-form">
                                        <?php 

                                            $landing_form = new WP_Query('pagename=landing-form');
                                            $landing_form -> the_post();

                                            the_content(); 

                                        ?>
                                    </div>  
                                </div>      
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

編輯

在 Wordpress 中,聯系表單似乎在模式上效果不佳。

我能想到的唯一解決方法是對其進行硬編碼並上傳到 FTP 服務器。

你有試過嗎

<?php echo do_shortcode('contact form 7 shortcode'); the_content(); ?>

代替

<?php 
    $landing_form = new WP_Query('pagename=landing-form');
    $landing_form -> the_post();
    the_content(); 
?>

有這種特定的原因嗎?

我有這個問題。 我忘了包括 wp_head(); 在關閉 head 標簽和 wp_footer() 之前; 在關閉正文標簽之前。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM