To create a login/logout link in WordPress you can use a snippet of php…
<?php if (is_user_logged_in()) : ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>">Logout</a> <?php else : ?> <a href="<?php echo wp_login_url(get_permalink()); ?>">Login</a> <?php endif;?>
If you just want a logout link only:
<?php if (is_user_logged_in()) : ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>">Logout</a> <?php endif;?>
If you just want a login link only:
<?php if (! is_user_logged_in()) : ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>">Login</a> <?php endif;?>
You can add this anywhere in your theme template files – if you want to add as a widget – you need to enable PHP for widgets.