Scroll to top

How to create custom wordpress logout button(wp_logout_url) in wordpress?


Notice: Undefined variable: string in /home/u665484253/domains/wpcodekit.com/public_html/wp-content/themes/twentytwenty-child/functions.php on line 61

custom wordpress logout button(wp_logout_url) in wordpress

<li class="menu-logout"><a href="<?php echo wp_logout_url(); ?>"><span><i class="fa fa-sign-out"></i></span>Logout</a></li>
Or
<li class="signOut"><?php wp_logout(); ?></li>

add_action( 'wp_logout', 'auto_redirect_external_after_logout');
function auto_redirect_external_after_logout(){
  wp_redirect( 'http://redirect-url' );
  exit();
}

Get more information

Read More Posts

Leave a Reply

Your email address will not be published.