A Broken Ninja Form

rbjordan3 Code ,

I was working on finishing up a custom WordPress theme for a new e-commerce website this week. I noticed something weird with ninja forms.

Broken Ninja form with no css loaded

My ninja forms rendered out completely broken. The form fields and information were there but with no CSS. Inspecting the network load of the page loading I noticed that wp-content/plugins/ninja-forms/assets/css/display-opinions-light.css was not getting retrieved. This meant there was absolutely no CSS for the form.  Exposing the “If you are human and seeing this field, please leave it empty.” field with very basic styling.

I figured I must have over-optimized and broke something.

Looking for where display-opinions-light.css was enqueued I found:

wp_enqueue_style( 'nf-display', $css_dir . 'display-opinions-light.css', array( 'dashicons' ) );

Since I don’t think most visitors to the site will need the dashicons. In my theme function.php file I had deregistered dashicons.


This completely broke ninja forms.

I removed wp_deregister_style(‘dashicons’) from the fucntions.php of the theme and it now works.

Just something I found that might help you out.