Skip to:
Content
Pages
Categories
Search
Top
Bottom

Login bar


  • jeroenkosterr
    Participant

    @jeroenkosterr

    Hello Guys,

    First of all great job on BBpress! Really like it!.(Hope i am in the right corner for my question)

    I got a question about a login bar i want to create. My website http://hardstyle-united.nl needs one under the navigation on the upper right side(It says “Hallo”) . I want to make it exactly how its build here on bbpress.

    Basically: When not logged in i want to show Hello Guest: Login | Register
    When logged in i would like to show: Hello “username” Avatar | Logout

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

  • Robin W
    Moderator

    @robin-w

    Maybe just have it on the menu?

    see

    login tab in

    https://wordpress.org/plugins/bbp-style-pack/


    jeroenkosterr
    Participant

    @jeroenkosterr

    Don’t want it on the menu. Sorry.


    Robin W
    Moderator

    @robin-w

    Don’t be sorry ! If that’s not where you want it.

    I don’t know of any plugin that does this – sorry 🙂


    jeroenkosterr
    Participant

    @jeroenkosterr

    I am not searching for a plugin actually. Need the php code to show these options.
    Maybe its a wordpress thing or maybe its a BBpress thing or maybe both.


    jeroenkosterr
    Participant

    @jeroenkosterr

    Already figured it out!

    Here is the code i used:

    <?php
    
    $current_user = wp_get_current_user();
            global $current_user;
            get_currentuserinfo();
    		
    if ( is_user_logged_in() ) {
      echo '<b>Welcome,</b> ' . $current_user->user_login . ''; 
      echo ' ';
      echo get_avatar( $current_user->ID, 20 );
    } else {
    	echo '<b>Welcome,</b> Guest! <a href="http://hardstyle-united.nl/register/">Register</a> or ';
    }
    ?> 
    	<?php wp_loginout(); ?>

    Robin W
    Moderator

    @robin-w

    Hey great – just had a look and it look good !

    Thanks for posting the answer back, it will help others

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