Load scripts and styles on Fluent Form conversational form landing page

tdrayson

Someone asked how you could load your own custom scripts and styles on a Fluent Form conversational form landing page since using the default wp_head() and wp_footer() functions from WordPress don’t get called.

Fluent Forms does however have their own hooks we can use to inject custom scripts and styles into the header and footer of the page.

Header hook

You can use the hook fluentform_conversational_frame_head to add CSS or Javascript to the header of the page.

PHP

        <?php
// Adds code to header
add_action('fluentform_conversational_frame_head', 'tct_conversational_header_script')
function tct_conversational_header_script(){ 
    ?> 
    <style>
        /* Add your CSS here */
    </style>
    <script>
        // Add your javascript here
    </script> 
    <?php 
}
      
Copy

You can use the hook fluentform_conversational_frame_footer to add CSS or Javascript to the footer of the page.

PHP

        <?php
// Adds code to footer
add_action('fluentform_conversational_frame_footer', 'tct_conversational_footer_script'); 
function tct_conversational_footer_script(){ 
    ?> 
    <style>
        /* Add your CSS here */
    </style>
    <script>
        // Add your javascript here
    </script> 
    <?php 
}

      
Copy

👋🏻 Weekly Tutorial Digest

I send out a weekly newsletter with links to new tutorials written in the last week, you can subscribe below.

Newsletter

🔒I won't send you spam, I promise