Aşağıdaki kodu kendi temanıza göre özelleştirerek istediğiniz olayı gerçekleştirebilirsiniz

<?php
if ( is_user_logged_in() ) {
    $current_user = wp_get_current_user();
    echo 'Kullanıcı Adı: ' . $current_user->user_login . '<br />';
    echo "<a href=" . wp_logout_url() . " title=\"Çıkış Yap\">Çıkış Yap</a>";
} else {
    echo "<a href=" . wp_login_url() . " title=\"Giriş Yap\">Giriş Yap</a> | ";
    echo "<a href=" . wp_registration_url() . " title=\"Kayıt Ol\">Kayıt Ol</a>";
}
?>