WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creating a Login "Widget" (7 posts)

  1. mercuryfenix
    Member
    Posted 5 years ago #

    I am having troubles finding the best way to add a login form widget without having to go to the default login page. I want to have a login form right on the homepage and it would be ideal to be able to put it anywhere else too. I have only found 1 function in the codex called wp_signon but there is a lack of information on usage and examples.

    Any help is appreciated!

    Thanks!

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

  3. mercuryfenix
    Member
    Posted 5 years ago #

    I was hoping there is a simple procedure, maybe make the form and submit it to a function. I am hoping to learn the procedure for use with my themes instead of relying on other plugins.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Ah. Well, no, there's nothing in WordPress specifically to generate the form for you. Basically though, if you make the form have the same fields as the form on the normal login page, then it will work. You can also add a hidden redirect field to redirect where you want to go to for the after-login page.

    Look at the form created by that plugin, then just copy the HTML form itself.

  5. mercuryfenix
    Member
    Posted 5 years ago #

    Right, I would create the form. Ideally, my own code would show the form, then upon submission via Ajax (or page refresh), it would log the user in.

    I wanted to leave the code hijacking to a last resort but it might have to do.

    Is there anything you can tell me about the wp function wp_signon?

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    .. I'm really not following you here. You don't need to know that function in order to log in. You don't need to know any functions, in fact. Just submit the form with the proper parameters to the wp-login.php script and it logs you in. Done.

  7. mercuryfenix
    Member
    Posted 5 years ago #

    Ah I see. I couldn't find any documentation on anything like this.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags