• Resolved Sakhawat Hossain

    (@sakhawat5)


    I want to style the form. And my CSS is loading in the head. Forminator CSS are loading in the body. And so my custom style can’t override the Forminator style. Why Forminator is not loading the styles in the head? How can I get the F styles loaded in the head? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @sakhawat5

    I hope you are doing well.

    Forminator CSS are loading in the body

    Could you confirm if you are using the latest Forminator version?

    Since 1.14.11 it will create a new CSS file in uploads/forminator and load the CSS from this path.

    https://monosnap.com/file/jg7ESncGH0pE0CYinNx7xiVuJQnPN8

    Indeed it is loading from the footer so the styles need to have a strong selector to override or using the !important on some cases. We did report this to the plugin developer, unfortunately, there is no temporary workaround for this.

    Let us know if you have any additional question
    Best Regards
    Patrick Freitas

    Thread Starter Sakhawat Hossain

    (@sakhawat5)

    Hi Patrick, Thanks for your response. Actually I need all the Forminator styles loaded in the head tag. And yes it is loading externally with link that is perfect. I am not going to use strong selector or important. Using important in general is something I don’t like. I have a common class that has the common styles for the buttons. The class styles are in a CSS file that is loading in the head tag. Simply I want to add the class to the Forminator button so that the button can get the same styles. But that is not happening since Forminator CSS are loading in the body. My question is: 1. Could not Forminator load the CSS in the head tag? Why in the body? Why after our main style? 2. Is there any way to get the Forminator styles loaded in the head? Thanks.

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    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

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @sakhawat5 ,

    We haven’t heard from you for almost a week now, so it looks like you no longer need our assistance.

    Please feel free to re-open this ticket if needed.

    kind regards,
    Kasia

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Forminator styles loading place issue’ is closed to new replies.