samedi 18 avril 2015

Login redirect to specific login page

I have this code to create a Login/Logout button in the top right header.



add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
ob_start();
if ( is_user_logged_in() ) {
wp_loginout('index.php');
} else {
wp_loginout( get_permalink( get_page_by_title( 'La mia pagina' ) ) );
}
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '<li>'. $loginoutlink .'</li>';
return $items;
}


It works perfectly but when I click on Login it takes me to the wp-login.php with a redirect to 'La mia pagina'.


I'd like it to take me to the new login page I created (title "login" es. http://ift.tt/1eMwUf7).


I cannot see where to apply these changes. Thanks for helping!


Aucun commentaire:

Enregistrer un commentaire