WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a shortcode for the login form to use on a page.

I have manage to get a simple form, but am looking to add the "forgot password link"

Here is what I have so far ... any way to add to this to have the form with the forgot link?

add_action( 'init', 'onco_add_shortcodes' );

function onco_add_shortcodes() {

    add_shortcode( 'onco-login-form', 'onco_login_form_shortcode' );

function onco_login_form_shortcode() {

    if ( is_user_logged_in() )
        return '<p>You are already logged in!</p>';

    return wp_login_form( array( 'echo' => false ) );
share|improve this question

To get the URL for lost password use wp_lostpassword_url()


share|improve this answer
I saw that reference, but the problem is that it takes the user away from my page with the form on it ... which defeats having the custom page. – Matthew Woodard Jan 20 '14 at 6:49
Well you said you want the, and I quote you: "form with the forgot link". You have the form and you want to add a link. The link goes somewhere - which is obvious. So please clarify you needs. – Borek Jan 20 '14 at 7:02
@MatthewWoodard Any progress on clarifying your needs? – kaiser May 1 '14 at 22:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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