Friday , December 20 2024

Contact form in a pop-up window

One of the most popular forms for WordPress is Contact Form 7, but in the settings there is no way to call the form through a click. You can download the Easy Fancybox plugin, go to Settings – Media and in the Enable FancyBox for block, uncheck Images, and check the box for Inline Content.

Save the settings, then edit the footer.php file, add the following code:

<div style="display:none" class="fancybox-hidden">
    <div id="contact_form_popup">
        <?php echo do_shortcode('[contact-form-7 id="6" title="Contact form 1"]'); ?>
    </div>
</div>

Where instead of [contact-form-7 id=”6″ title=”Contact form 1″] add your form shortcode.

Displaying a popup form using a text editor

<div style="display:none" class="fancybox-hidden">
    <div id="contact_form_popup">
        [contact-form-7 id="6" title="Contact form 1"]
    </div>
</div>

Similarly, replace the shortcode with your actual one.

Display a button that will open a popup form window when clicked

<a href="#contact_form_popup" class="fancybox-inline">Заказать звонок</a>

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section

I tried solutions with functions that should remove from head and , but a very …

Leave a Reply

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