Title: Frontend Display
Last modified: August 21, 2016

---

# Frontend Display

 *  Resolved [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * (@dlocc)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/frontend-display/)
 * Hey I noticed there’s no clear documentation on how to display this data on the
   frontend so I figured I would share this code:
 *     ```
       global $current_user;
       $user_last_login_timestamp = get_user_meta( $current_user->id, 'wp-last-login', true );
       $user_last_login = date('F j, Y g:i a', $user_last_login_timestamp); //see date() for more info in PHP manual
       echo '<p>Last login:'.$user_last_login.'</p>';
       ```
   
 * Basically this is pulling the timestamp from usermeta and formatting it. It’s
   easily customizable. Hopefully this helps someone out.
 * [https://wordpress.org/plugins/wp-last-login/](https://wordpress.org/plugins/wp-last-login/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Devin Walker](https://wordpress.org/support/users/dlocc/)
 * (@dlocc)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/frontend-display/#post-5053092)
 * Oh also, here’s a shortcode option for easy use within your site page/post content:
 *     ```
       /**
        * Last Login Shortcode
        *
        * Works with WP Last Login plugin
        *
        */
       function wp_last_login_shortcode( $atts ) {
       	global $current_user;
       	$user_last_login_timestamp = get_user_meta( $current_user->id, 'wp-last-login', true );
       	$user_last_login = date('F j, Y g:i a', $user_last_login_timestamp); //see date() for more info in PHP manual
   
           return $user_last_login;
       }
       add_shortcode( 'wp_last_login', 'wp_last_login_shortcode' );
       ```
   
 *  [sbdm05](https://wordpress.org/support/users/sbdm05/)
 * (@sbdm05)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/frontend-display/#post-5053414)
 * Hello Devin!
    Thanks for sharing this! I have a question though: How to display
   this data on every profile user page instead of the current user?
 * Many thanks for your help !
    I am really beginner at wp function so your help
   will be very much appreciated !
 * Best, Sonia

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Frontend Display’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-last-login.svg)
 * [WP Last Login](https://wordpress.org/plugins/wp-last-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-last-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-last-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-last-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-last-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-last-login/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [sbdm05](https://wordpress.org/support/users/sbdm05/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/frontend-display/#post-5053414)
 * Status: resolved