WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Favicon no show at login, does show in dashboard (6 posts)

  1. jknetdesign
    Member
    Posted 2 years ago #

    I used this function to get the favicon in the admin(dasboard) but it doesn't show in the login (where you login).

    function favicon4admin() {
    echo '<link rel="Shortcut Icon" type="image/x-icon" href="http://gardengoddesses.org/wp-content/themes/acoustic_v102/images/favicon.ico" />';
    }
    add_action( 'admin_head', 'favicon4admin' );

  2. pedrogas_g
    Member
    Posted 2 years ago #

    Use login_head for add your favicon wp_login.php.

    add_action( 'login_head', 'favicon4admin' );

  3. jknetdesign
    Member
    Posted 2 years ago #

    So do I use two add actions:
    function favicon4admin() {
    echo '<link rel="Shortcut Icon" type="image/x-icon" href="http://www.crhouseinc.com/wp-content/themes/crhouse/images/favicon.ico" />';
    }
    add_action( 'admin_head', 'favicon4admin' );
    add_action( 'login_head', 'favicon4admin' );

    or just use login_head instead of admin_head?

    Is this because of the new WP? because it works on my older sites.

  4. pedrogas_g
    Member
    Posted 2 years ago #

    admin_head was removed for the wp_login,
    I think you should be use the two for a better semantic, you can use another action as well, but try to keep separed the login of the admin is cleener

  5. jknetdesign
    Member
    Posted 2 years ago #

    Just to be clear could you paste the entire function you're suggesting please?

  6. pedrogas_g
    Member
    Posted 2 years ago #

    the easy way is this

    add_action( 'wp_print_scripts', 'favicon4admin' );

    A Happy New Year to you

Topic Closed

This topic has been closed to new replies.

About this Topic