New Landing How can we help? Themeforest Theme Support Dante How to edit sf-header.php to add link in that navigation area? ie. Sign Up

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #114272
    mhote
    Member
    Post count: 394

    Hi, I’ve been able to change the sf-header.php to display ‘Log In’, but I need to add a ‘Sign Up’ button next to the log in button. Once a user has logged in status, this sign up button then wouldn’t display. I know how to display none that button when the user logs in, but how can this ‘sign up’ link be added to that text area?

    #114419
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    You can use a code similar to the one below. It will only echo that content when the user is not logged in.
    You should add it in the sf-header.php in the desired place.

    <?php
    if (!is_user_logged_in() ) {
    	echo '<a href="link">Sign up</a>';
    }
    ?>

    -Rui

    #114707
    mhote
    Member
    Post count: 394

    Great, thanks Rui. That whited the screen for me at least, but copying the Login section and adding Sign Up with the below code worked.

    
    } else {
    					$aux_links_output .= '<li><a href="'.$login_url.'">'. __("Log In", "swiftframework") .'</a></li>'. "\n";		
    					$aux_links_output .= '<li><a href="'.$login_url.'">'. __("Sign Up", "swiftframework") .'</a></li>'. "\n";		
    				}
    
    For other readers, you can then style this 2nd 'Sign Up' child link with: 
    
    

    .top-header-menu .menu > li:nth-child(2) > a {
    background-color: #0274be;
    text-align: center !important;
    border-radius: 5px;
    color: #ffffff;
    font-weight: 500;
    margin-top: 10px !important;
    min-width: 66px !important;
    padding: 1px 12px 3px !important;
    margin-left: 4px !important;
    }`

    #114719
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Great 🙂 Thanks

    – Kyle

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register