• The includes/style.css file is being loaded on every single page in the admin area. This is affecting things like form field styles across the entire admin area.

    Here’s a fix to only load it on the Adelle Getting Started page:

    File: includes/adelle_getting_started.php

    Fixed code:

    function adelle_getting_started_style( $hook ) {
    	if ( 'appearance_page_adelle_getting_started' == $hook ) {
    		wp_register_style( 'adelle-getting-started-style', get_template_directory_uri() . '/includes/style.css', false, '1.0.0' );
    		wp_enqueue_style( 'adelle-getting-started-style' );
    	}
    }
    add_action( 'admin_enqueue_scripts', 'adelle_getting_started_style' );
  • The topic ‘Fix: Stop loading CSS in entire admin area’ is closed to new replies.