<?php
/* Template Name: User Dashboard */
get_header();

if ( ! is_user_logged_in() ) {
  wp_redirect( wp_login_url() );
  exit;
}
$current_user = wp_get_current_user();
?>

<div class="container py-5">
  <h2><?php echo sprintf(__('Welcome, %s!', 'howcan'), esc_html($current_user->display_name)); ?></h2>
  <p><?php _e('This is your dashboard.', 'howcan'); ?></p>
  <a href="<?php echo wp_logout_url(home_url()); ?>" class="btn btn-danger"><?php _e('Logout', 'howcan'); ?></a>
</div>

<?php get_footer(); ?>