Answers for "how to display element when user is logged in wordpress"

PHP
1

how to check if user is logged in wordpress

<?php 
if ( is_user_logged_in() ) {
  echo 'Welcome, logged in user. <a href="'.wp_logout_url().'">Click here to logout</a>.';
}else{
  echo 'Please login by <a href="'.wp_login_url().'">clicking here</a>.'
}
Posted by: Guest on April-30-2021
0

detect logged user wordpress javascript

document.body.classList.contains( 'logged-in' );
Posted by: Guest on March-12-2020

Code answers related to "how to display element when user is logged in wordpress"

Browse Popular Code Answers by Language