Hi @sakhawat5,
By default, we only load the assets in the header if the assets are used in all the pages. Since we don’t know which page the form will be used, Forminator only loads the assets when the page uses the shortcode.
The recommended solution is to move the custom CSS files to the footer.
However, if you need to load the Formiantor CSS files in the header, you need to register the CSS again in the header which will be called on every page if not a condition is used to load them only on the pages with Forminator form. Please check the following code as a reference:
<?php
add_action( 'wp_enqueue_scripts', function(){
// add conditional.
if( is_single() && has_shortcode( get_the_content(), 'forminator_form' ) ){ //or for specific page: if( is_page(123) )
// copy all CSS related to formiantor
wp_enqueue_style( 'forminator-icons', 'copy forminator css path here' );
//...
wp_enqueue_style( 'forminator-forms-default-full', 'copy forminator css path here' );
// }
} );
Please ask, if you have any questions. We are happy to clarify.
Kind Regards,
Nebu John