Monday , February 3 2025

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 iryna

I'm Iryna, a web developer from Ukraine with a decade of experience solving complex technical challenges in the world of freelance. Throughout my career, I've worked on everything from troubleshooting server-side issues and optimizing website performance to enhancing user interfaces. On this blog, I share detailed solutions to the technical problems I’ve encountered and methods that have worked best for me. In addition to my technical expertise, I’m also passionate about digital drawing. I hope the tutorials and insights I provide here will help both fellow developers and creatives alike in their own projects.

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 *