Skip to:
Content
Pages
Categories
Search
Top
Bottom

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


  • jappan
    Participant

    @jappan

    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

    @jappan

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


    jappan
    Participant

    @jappan

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


    Robin W
    Moderator

    @robin-w

    bbp style pack

    dashboard>settings>bbp style pack>buttons


    jappan
    Participant

    @jappan

    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

    @jappan

    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

    @jappan

    I plan to use CSS to manage the placement.


    jappan
    Participant

    @jappan

    I achievement this php problems! THX!


    Robin W
    Moderator

    @robin-w

    great – can you post your solution to help others


    jappan
    Participant

    @jappan

    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

    @robin-w

    🙂

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