• Hi hannan

    sorry i wast trying to figure it out by me self but failed.

    all i wanted to do is, add an option on the top bar where there will be an option of login and log out option with a welcome message when the user is logged init will show “Good Day User ID | Logout”, therefore i have managed to get the option on to topbar by adding in heared-topbar.php

    <div class="user-status">
      <?php
      if (is_user_logged_in()) {
      $user = wp_get_current_user();
      echo 'Welcome back '.$user->display_name.'! ', wp_loginout();
      } else { ?>
      Please <strong><?php wp_loginout(); ?></strong>
      or <a href="<?php echo get_option('home'); ?>/wp-login.php?action=register"> <strong>Register</strong></a>
      <?php } ?>
      </div> <!-- end user status -->

    the links are working fine. the only problem i have is, it turning up in different way in different devices. also Ive added the above code after the following lines in heared-topbar.php

    </div>
            <div class="user-status">

    do you follow?

    is there any solution to resolve these issue?

Viewing 8 replies - 1 through 8 (of 8 total)
  • What kind of issues are you having with the display in other devices? If you can specify the issues you’re having, I may be able to fix it with some CSS.

    Also, you’re using a Child Theme, correct? If not, I really suggest that you get one setup as soon as possible. If you’re making direct edits to the theme files, then you risk losing the changes in an update.

    Here you can read about and download a child theme:
    https://www.kadencethemes.com/child-themes/

    -Kevin

    Thread Starter koustab

    (@koustab)

    Hi Kevin

    Thanks for ur reply. I’m using a child theme.

    I was totally unaware of the two section in Topbar.

    All I want is login | logout and cart on aligned to the left side and search bar right.

    I’ve added the following CSS in custom CSS

    .col-md-6.col-sm-6.kad-topbar-left {
    float: left;
    width: 30%;
    }

    .topbarmenu.clearfix {
    float: left;
    }

    .col-md-6.col-sm-6.kad-topbar-right {
    float: right;
    width: 50%;
    }

    .topbarmenu.clearfix {
    float: right;
    }

    .kad-cart-total {
    position: relative;
    }
    .cart-contents {
    text-indent: -9999px;
    min-width: 70px;
    }
    .cart-contents .amount {

    text-indent: 0;
    position: absolute;
    right: 10px;
    }
    .cart-contents .amount:before {
    font-family: FontAwesome;
    font-weight: 400;
    font-style: normal;
    text-decoration: inherit;
    -webkit-font-smoothing: antialiased;
    line-height: 1;
    text-transform: none;
    padding-right: 10px;
    }

    @media (min-width: 767px)
    .col-md-6.col-sm-6.kad-topbar-left {
    float: left;
    width: 100%;
    }

    .topbarmenu.clearfix {
    float: left;
    }

    .col-md-6.col-sm-6.kad-topbar-right {
    float: right;
    width: 100%;
    }

    }

    You should be able to just create some menu items with the desired URL’s in Appearance> Menus.

    Create a topbar menu, create your menu items, and assign it to the topbar.

    If you just use menu items, then you wont need any custom CSS. See the demo site:
    https://themes.kadencethemes.com/virtue/

    You can have the exact same layout in your topbar with a menu and search. Just make your own menu and you’ll be set.

    Can you post a link?

    Thread Starter koustab

    (@koustab)

    hi

    Sorry I should have add the link before.

    https://www.aphilatelicoutlet.com

    Thanks

    I’m seeing the line-height off. As well as the color… here is some css. becuase I don’t have a login I can’t see what this looks like logged-in

    #topbar .user-status {
        line-height: 34px;
        float: left;
        color: white;
    }
    #topbar .user-status a {
        color: white;
    }

    Kadence Themes

    Thread Starter koustab

    (@koustab)

    If u kindly gimme ur email I will send you the logging and password.

    Koustab

    Use the contact forum here: https://www.kadencethemes.com/contact-us/

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘topbar login / logout with a welcome message’ is closed to new replies.