Change 'Site Admin' text

  • BusterSenshi

    #6593

    I would like to change the “Site Admin” text on the meta widget

    tnJ4k.png

    Prasanna SP

    #34984

    Throw this to child theme‘s functions.php (If the functions.php file empty, put the below code after <?php)

    function change_site_admin_text( $link ){
    if ( ! is_user_logged_in() ) {
    if ( get_option('users_can_register') )
    $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else {
    $link = $before . '<a href="' . admin_url() . '">' . __('Dashboard') . '</a>' . $after;
    }
    return $link;
    }
    add_filter( 'register' , 'change_site_admin_text');

    This will change the Site Admin text to Dashboard. You can change this to whatever you want.

    BusterSenshi

    #34985

    Perfect, thank you 🙂

    BusterSenshi

    #34986

    So it worked, however I have lost a break between the links:

    http://www.30dayslater.net/upgrade/

    See how “Control Panel” does not have a line under it?

    After/Before:

    cMiRv.jpgtnJ4k.png

    Prasanna SP

    #34987

    Add li tag before a href ..

    I’m on mobile now. So can’t write full code. Try it yourself, or I’ll give you the updated code tomorrow.

    BusterSenshi

    #34988

    Totally worked, thank you 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.