0

I have added the code below to my functions.php to add a "Login" Link to my wp menu.

 $newlink = '<li>' . $args->before . '<a title="Login" href="'. wp_login_url('index.php') .'">' . $args->link_before . 'Login' . $args->link_after . '</a>' . $args->after;

how can i change wp_login_url function to use another page? For example, I'm using the mingle plugin which creates a custom login page.

code below from wp-includes/general-template.php

 function wp_login_url($redirect = '', $force_reauth = false) {
        $login_url = site_url('wp-login.php', 'login');

        if ( !empty($redirect) )
                $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url);

        if ( $force_reauth )
                $login_url = add_query_arg('reauth', '1', $login_url);

        return apply_filters('login_url', $login_url, $redirect);
}

1 Answer 1

0

I would not recommend changing the core code of WordPress as you will likely break the install.

Can you not just update your functions.php file line of code to be something like:

 $newlink = '<li>' . $args->before . '<a title="Login" href="/login/">' . $args->link_before . 'Login' . $args->link_after . '</a>' . $args->after;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.