Skip to:
Content
Pages
Categories
Search
Top
Bottom

I want to set login&profile button in the Header section

  • @jappan

    Participant

    Need help.

    hello, i’m a Japanese, so I’m sorry if my English is inconvenient…

    I want to set the button like this website!

    ↓To be more specifically↓
    If the user is not logged in, I would like to set the login or membership registration button, and if the user is logged in, I would like to set the profile button on on the header.

    This is my website link [https://tokyolyric.com/]

Viewing 10 replies - 1 through 10 (of 10 total)
  • @jappan

    Participant

    i want to set bottun like thisi want to set button like tis

    @jappan

    Participant

    i’m making a website for programming learning, so i’d like to know the answer…

    @robin-w

    Moderator

    bbp style pack

    dashboard>settings>bbp style pack>buttons

    @jappan

    Participant

    Thank you Mr.Robin!!!
    I tried using PHP code to put this button in place.
    ↓Here is the code↓

    <!DOCTYPE html>
    <html lang="ja">
    <head>
    <div class="login-box">
    <?php if ( is_user_logged_in() ) : ?>
        <?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ); ?>
    <?php global $user_identity; echo $user_identity; ?>
    	<a href="<?php echo wp_logout_url( bp_get_root_domain() ) ?>">ログアウト</a>
    <?php else : ?>
    	<a href="https://tokyolyric.com/wp-login-php">ログイン</a>
    <?php endif; ?>
    </a>
    </div>
    </head>

    but I can’t go to “user’s profile page” from “the user’s image” and “user name”.

    please let me know if there is any description to add to the code!!!

    This is my website URL

    @jappan

    Participant

    The profile above is from the login-widget, and the profile below is from my php code.
    However, it doesn’t not have a link to the user’s profile.

    I would like to add a link to the profile screen in the image and username like above one!!!

    please teach me…
    i’m sorry for the inconvenience

    @jappan

    Participant

    I plan to use CSS to manage the placement.

    @jappan

    Participant

    I achievement this php problems! THX!

    @robin-w

    Moderator

    great – can you post your solution to help others

    @jappan

    Participant

    Ok! Mr.Robin
    This is my code

    <!DOCTYPE html><html lang="ja"><head><div class="login-box">
    <?php if ( is_user_logged_in() ) : ?>
     <a href="<?php echo bp_loggedin_user_domain(); ?>
    "><?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ); ?></a><?php global $user_identity; echo $user_identity; ?>
    <a href="<?php echo wp_logout_url( bp_get_root_domain() ) ?>">logout</a>
    <?php else : ?><a href="http://localhost/wp01/wp-login-php">login</a><?php endif; ?></div></head>

    @robin-w

    Moderator

    🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar