Adding register & login in WordPress website

Question

I am adding register and login to WordPress website. I am using the following code:

<?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_e( 'Login', 'textdomain' ) . '">';
            echo _e( 'Login', 'textdomain' );
        echo '</a>';
        wp_register('', '');
        else :
            echo 'Hello ' . $c_user->display_name;
        endif;
        ?>

After using the code, only the login text is showing. But I want to add “regsite & login”. If the user is login, it should be replaced with display “name & logout” text

0
, imtango30 3 years 2020-04-05T16:50:57-05:00 0 Answers 81 views 0

Leave an answer

Browse
Browse