Login and Logout top right links using wp functions
This commit is contained in:
parent
0bd356ab10
commit
baf87075d3
@ -31,12 +31,13 @@ if ( !is_active_sidebar( 'top-widget' )
|
|||||||
<?php global $current_user;
|
<?php global $current_user;
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
if (!is_user_logged_in()) {
|
if (!is_user_logged_in()) {
|
||||||
echo "<a class='mytoplink' href=".site_url('/login/').">".__('Login')."</a> / ";
|
echo "<a class='mytoplink' href=".wp_login_url( get_permalink() ).">".__('Login')."</a> / ";
|
||||||
echo "<a class='mytoplink' href=".site_url('/register/').">".__('Register')."</a> ";
|
echo "<a class='mytoplink' href=".site_url('/register/').">".__('Register')."</a> ";
|
||||||
} else {
|
} else {
|
||||||
get_currentuserinfo();
|
get_currentuserinfo();
|
||||||
$a = sprintf( __('Howdy, %1$s'), $current_user->display_name );
|
$a = sprintf( __('Howdy, %1$s'), $current_user->display_name );
|
||||||
echo "<a class='mytoplink' href=".site_url('/forums/users/').$current_user->display_name.">".$a." ".get_avatar( $current_user->ID, 20 )."</a> ";
|
echo "<a class='mytoplink' href=".site_url('/forums/users/').$current_user->display_name.">".$a." ".get_avatar( $current_user->ID, 20 )."</a> ";
|
||||||
|
echo "/ <a class='mytoplink' href=".wp_logout_url( get_permalink() ).">".__('Logout')."</a> ";
|
||||||
}
|
}
|
||||||
if ( function_exists ('the_msls' ) ) { echo " "; the_msls(); }
|
if ( function_exists ('the_msls' ) ) { echo " "; the_msls(); }
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user