wordpressauthor

how can i show author registration date and time in author profile


How can I display the author’s registration date and time in the author profile? I want to show the author’s registration date and time in the bio information on the single.php page. I have already tried some tips, but I wasn't successful.

https://wordpress.org/support/topic/get-the-date-a-user-registered?replies=5 https://wordpress.stackexchange.com/questions/77876/show-user-registration-date-in-wordpress


Solution

  • You can use the the_author_meta function as so:

    <?php 
        echo the_author_meta( 'user_registered', 1 ); 
    ?>
    

    ..where the first parameter is a string parameter and the second (in this case, 1) is the user id. This is explicit. To be more implicit, you could simply pass the user id in as so. This must be done within the WP loop:

    <?php 
        $user_ID = $post->post_author;
        echo the_author_meta( 'user_registered', $user_ID ); 
    ?>
    

    If you are using a custom authentication plugin or extension of some sort, you will need to return the id from that object instead. However, it is unclear from your question if that is the case.