Stooping a css file from loading in the header

Question

I’m using the plugin ‘Ninja From’ and I’m trying to stop it from loading a CSS file in the header.

The CSS file:

<link rel='stylesheet' id='nf-display-css'  href='http://example.com/wp-content/plugins/ninja-forms/assets/css/display-structure.css?ver=4.7.1' type='text/css' media='all' />

My code:

function remove_css_ninja_form(){
    wp_dequeue_style('nf-display-css');
    wp_deregister_style('nf-display-css');
}

add_action( 'wp_enqueue_scripts', 'remove_css_ninja_form', 99999 );
add_action( 'wp_print_styles', 'remove_css_ninja_form', 99999 );
add_action( 'wp_head', 'remove_css_ninja_form', 9999 );

It is not working.

0
Rex 2 years 2020-01-12T08:42:23-05:00 0 Answers 49 views 0

Leave an answer

Browse
Browse