Conditional Wordprss login/logout


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. if ( is_user_logged_in() ) {
  3. echo '<a href="'.wp_logout_url( get_permalink() ).'" title="Logout" class="hunderline">Logout</a>';
  4. } else {
  5. echo wp_login_form( $args );
  6. }
  7. ?>

URL: http://wordpress.org/support/topic/conditional-loginlogout-link

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.