• Resolved Todd

    (@toddneufeld)


    I’m trying to load a custom style sheet in my mu_plugins folder. The stylesheet is in in mu_plugins/login/login-styles.css, and I’d like to load it properly using the path to mu_plugins instead of hard-coding the full path.

    I can’t figure out the syntax to load it, so I’m using the full URL, which seems a little hacky:

    ‘function custom_login_css() {
    echo ‘<link rel=”stylesheet” type=”text/css” href=”https://mydomain/wp-content/mu-plugins/login/login-styles.css”>&#8217;;
    }
    add_action(‘login_head’, ‘custom_login_css’);’

    Does anyone know the code for the path to files in the mu_plugins folder?

    Thanks,

    -Todd

Viewing 4 replies - 1 through 4 (of 4 total)
  • WPMU_PLUGIN_DIR
    or
    WPMU_PLUGIN_URL

    https://codex.www.ads-software.com/Must_Use_Plugins

    Example:

    <?php // mu-plugins/load.php
    require WPMU_PLUGIN_DIR.'/my-plugin/my-plugin.php'; ?>

    or in your snippet it may look something like this:

    echo '<link rel="stylesheet" type="text/css" href="'. WPMU_PLUGIN_URL.'/login/login-styles.css">';

    Thread Starter Todd

    (@toddneufeld)

    I read that page about a dozen times, and did some googling. Maybe I just haven’t gotten the syntax right.

    The only typo I see above is “mu_plugins” or “mu-plugins”.

    The folder must be “mu-plugins” for the default constant to work.

    Thread Starter Todd

    (@toddneufeld)

    I was missing a period! I didn’t have the “.” before the constant.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What's the path to mu_plugins?’ is closed to new replies.