Home / Admin / How to Link Your Conversational Form Logo
Duplicate Snippet

Embed Snippet on Your Site

How to Link Your Conversational Form Logo

This code snippet will make the logo clickable in a WPForms Conversational Form.

<10
Code Preview
php
<?php
/**
* Link your form logo on conversational forms.
*
* @link https://wpforms.com/developers/how-to-link-your-conversational-form-logo
*/
function wpf_dev_conversational_form_add_link() {
    ?>
    <script type="text/javascript">
    jQuery(function($) {
        var formID = 375; // ID of conversational form to which applies
        
        if ($('#wpforms-' + formID).length === 0) {
            return;
        }
        
        // Detect Conversational Form image.
        var $logo = $('#wpforms-conversational-form-page').find('.wpforms-conversational-form-logo');
        if ($logo.length > 0) {
            $logo.wrap($('<a>', {
                href: '/' // "/" could be changed to any link.
            }));
        }
    });
    </script>
    <?php
}
add_action('wpforms_wp_footer', 'wpf_dev_conversational_form_add_link');

Comments

Add a Comment