Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #244762

    Zeshan
    Member

    Hi there,

    We’d really love to help you further on this but as this is a page created using a 3rd party plugin “Theme My Login”, regretfully, we cannot provide support for it as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, styling, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

    Thank you for your understanding.

    #278867

    immithaca
    Participant
    This reply has been marked as private.
    #279126

    Rue Nel
    Moderator

    Hello There,

    The logout link, login link is generated by WordPress itself. You can have a redirect in it. Please refer to this page:
    https://codex.wordpress.org/Function_Reference/wp_login_url
    https://codex.wordpress.org/Function_Reference/wp_logout_url

    To edit your members portal link, just replace this code and insert your link

    
    '<a href="http://insert-your-link-here/" class="x-btn-navbar-my-account">'
    

    Please let us know if this works out for you.

    #832098

    Lisa
    Participant

    Hi There,

    Is it also possible to have this Login/Logout Link changed in a way to have the Links in my topbar?
    Would be awesome!

    Regards,
    Lisa

    #832629

    Jade
    Moderator

    Hi Lisa,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Create _topbar.php file inside YOUR CHILD THEME -> framework -> views -> global and add this code in there:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
          <ul class="buttons">      
          	<li><a class="x-btn x-btn-red x-btn-real x-btn-rounded x-btn-regular" href="<?php echo wp_login_url(); ?>"><i class="x-icon x-icon-sign-out"></i> <span><?php echo __( 'Log In', '__x__' ); ?></span></a></li>
          	<li><a class="x-btn x-btn-red x-btn-real x-btn-rounded x-btn-regular" href="<?php echo wp_logout_url(); ?>"><i class="x-icon x-icon-sign-out"></i> <span><?php echo __( 'Log Out', '__x__' ); ?></span></a></li>
          </li>
        </div>
      </div>
    
    <?php endif; ?>

    Then add this in the Custom CSS:

    .x-topbar .buttons { float: right; }
    .x-topbar .buttons li { display: inline-block; }

    Hope it helps.

    #832630

    Jade
    Moderator

    Hi Lisa,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Create _topbar.php file inside YOUR CHILD THEME -> framework -> views -> global and add this code in there:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
          <ul class="buttons">      
          	<li><a class="x-btn x-btn-red x-btn-real x-btn-rounded x-btn-regular" href="<?php echo wp_login_url(); ?>"><i class="x-icon x-icon-sign-out"></i> <span><?php echo __( 'Log In', '__x__' ); ?></span></a></li>
          	<li><a class="x-btn x-btn-red x-btn-real x-btn-rounded x-btn-regular" href="<?php echo wp_logout_url(); ?>"><i class="x-icon x-icon-sign-out"></i> <span><?php echo __( 'Log Out', '__x__' ); ?></span></a></li>
          </li>
        </div>
      </div>
    
    <?php endif; ?>

    Then add this in the Custom CSS:

    .x-topbar .buttons { float: right; }
    .x-topbar .buttons li { display: inline-block; }

    Hope this helps.

    #833246

    Lisa
    Participant

    Hi,

    Thanks for your response.
    I wanted to have a dropdown in my topbar, see attched picture1.
    What I see with the provided code you see in picture2.
    Also it needs to be a link that displays “login” when the user is not logged in, and “logout” when the user is logged in. “My account” should be displayed everytime.

    Thanks,
    Lisa

    #833255

    Zeshan
    Member

    Hi Lisa,

    It’s not possible to show a dropdown menu in the topbar without deep CSS and template modifications, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

    Thanks for understanding. Take care!

    #833265

    Lisa
    Participant

    So is it possible to have a changing link in topbar?
    Just like you see in picture, but with Login/Logout depending on the users status.

    #833288

    Paul R
    Moderator

    Hi,

    Yes, it’s possible.

    You may replace the code in your _topbar.php with this

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
          <span class="loginout"><?php wp_loginout(); ?></span>
        </div>
      </div>
    
    <?php endif; ?>
    

    Hope that helps.

    #833294

    Lisa
    Participant

    Cool, it works!
    So how can I change the position and have it looking like the other links I’m going to have in my topbar? I also have to change the login and logout url, think that is a wordpress adjustment.

    Best,
    Lisa

    #833311

    Lely
    Moderator

    Hi Lisa,

    Glad it works. To help you better this time, please share your site URL. Then also give us a screenshot of what you want to achieve so the CSS suggestion will be exact.

    Always,
    X

    #833322

    Lisa
    Participant

    See my attachment.
    In the top right corner you can see two links I defined in the topbar content area. Login is going to be deleted, but there will be other links like “help” for example.
    So now I want to have the login/logout you provided to be integrated in this little menu (instead of the static Login-link)

    #833325

    Lisa
    Participant
    This reply has been marked as private.
    #833333

    Lely
    Moderator

    Hi Lisa,

    We have to update the _topbar.php code above to this:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?><span class="loginout"><?php wp_loginout(); ?></span></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
          
        </div>
      </div>
    
    <?php endif; ?>

    Hope this helps.