27 February 2021

If user is not login in wordpress And redirect to another page.

If the user is not login in to WordPress And redirects to another page. 


<?php


if(!is_user_logged_in()) {

    wp_redirect( site_url().'/login' );

}

 

?>


<a href="<?php echo wp_logout_url(site_url().'/login'); ?>">Logout</a>

No comments:

Post a Comment

How to download/create content in doc from website by adding code in chrome console?

 Download/Create content in doc from website by adding code in chrome console function exportHTMLtoDoc(elementId, fileName = 'document...