• I have used the wp_enqueue funtion to load customized style sheets. I have prevented them from loading on admin pages, and not on the login page which (I understand is not an admin page).
    – How do I write the conditional statement to prevent the styles from loading for both admin and the login pages.
    Here is my functions.php file using the TwentySixteen parent theme.

    <?php
    // register styles
       wp_register_style('parent-style',  get_template_directory_uri() . '/style.css');
    // load styles only if this is not an admin page
    if ( ! is_admin() )
       wp_enqueue_style( 'parent-style');
    ?>
Viewing 1 replies (of 1 total)
  • Thread Starter cse7

    (@cse7)

    I found the solution in a posting from three years ago. The new functions.php file looks like this:

    <?php
    // register styles
       wp_register_style('parent-style',  get_template_directory_uri() . '/style.css');
    // load styles only if this is not an admin or login page
    global $pagenow;
    if ( ! is_admin() && 'wp-login.php' != $pagenow )
       wp_enqueue_style( 'parent-style');
    ?>

Viewing 1 replies (of 1 total)

The topic ‘Stop wp_login.php from loading non-admin styles’ is closed to new replies.