Using the [woocommerce_my_account]
shortcode, a user will see their account details if they're logged in and if they're not logged in, they'll see a login and registration form.
Using the same page title "My Account" for these different users isn't ideal because a user that has never created an account won't naturally navigate to a "My Account" page in order to create an account.
A possible solution is to add the page that includes that shortcode twice to your navigation menu, name them "Login" and "My Account", and give them separate classes:
Then we can control the visibility of the navigation links based on if a user is logged in:
add_action('wp_head','jg_user_nav_visibility');
function jg_user_nav_visibility() {
if ( is_user_logged_in() ) {
$output="<style> .nav-login { display: none; } </style>";
} else {
$output="<style> .nav-account { display: none; } </style>";
}
echo $output;
}