WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] MU Theme Login Display (5 posts)

  1. ajtwist
    Member
    Posted 5 years ago #

    I'm using this "MU Theme Login" code I found to have a Login/Register link in my header links. The coding is

    <body>
    <div id="rap">
    <div id="header">
    <ul id="topnav">
    <li><a href="http://blogs.sitename.com/">blogs.sitename.com</a> | </li>
    <li><?php wp_register(' ' , ' '); ?> | </li>
    <li><?php wp_loginout(); ?> | </li>

    It works perfectly fine. My problem is the text they display as links.
    When you are not logged in it reads "Register | Log In" which is good. Once logged in the text changes to "Site Admin | Log Out"
    How do I change the "Site Admin" text to something different?

  2. kapiljain.in
    Member
    Posted 5 years ago #

    By default wp_register() function have only 2 parameters. You can't do it by using function.

    To solve this issue just replace wp_register('','') with wp_register() function code given below, and then you can change Site Admin text and link:

    if ( ! is_user_logged_in() ) {
    if ( get_settings('users_can_register') )
    $link = $before . '<a href="' . get_settings('siteurl') . '/wp-register.php">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else {
    $link = $before . '<a href="' . get_settings('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
    }
    echo apply_filters('register', $link);

    Reference: http://mu.wordpress.org/forums/topic.php?id=1396

  3. Mark / t31os
    Moderator
    Posted 5 years ago #

    Might be easier to just use the wp_loginout(); function... *IGNORE*

    Ref: http://codex.wordpress.org/Template_Tags/wp_loginout *IGNORE*

    Sorry read the thread a little to quick, the above is correct...

    The function returns the admin link...

    Replace the function with what is suggested.

  4. ajtwist
    Member
    Posted 5 years ago #

    Cool, thx peeps!

  5. kapiljain.in
    Member
    Posted 5 years ago #

    @ajtwist

    If worked fine, request you to please close this issue.

Topic Closed

This topic has been closed to new replies.

About this Topic