I’m engaged on WordPress web site and utilizing the next code for registration and login.
<?php
$c_user = wp_get_current_user();
if( !is_user_logged_in( $c_user->ID ) ) :
echo '<a href="' . esc_url( wp_login_url() ) . '" alt="' . esc_attr( 'Login', 'textdomain' ) . '">';
echo _e( 'Login', 'textdomain' );
echo '</a>';
wp_register(' / ', '');
else :
echo 'Hiya ' . $c_user->display_name . ', ';
echo ' <a href="' . esc_url( wp_logout_url( home_url() ) ) . '" alt="' . esc_attr( 'Logout', 'textdomain' ) . '">';
echo _e( 'Logout', 'textdomain' );
echo '</a>';
endif;
?>
I wish to use login after register hyperlink and after login, it reveals “Hiya Imtango30, Logout”. Is there a solution to hyperlink “Imtango30” with a customized hyperlink, e.g instance.com? and assign a special CSS class to register/username and login/logout button so I might add a couple of CSS too?