0
votes

I want to implement a custom login module inside wordpress. In the home page, I have this form where the users could register and another form where the users can login to the website.

Is it a better Idea to write custom code inside wordpress to accomplish my goal?

What other alternative do you suggest to it ?

3

3 Answers

0
votes

Nothing is wrong with writing custom code if you need something specific to happen when a user logs in. Other than writing custom code also is that you could just get an already built plugin!

0
votes

You can use this code to create a WordPress login form on any page.

<div id="login">


<form name="loginform" id="loginform" action="YOUR_WORDPRESS_FOLDER/wp-login.php" method="post">
<label>Username:<input type="text" name="log" id="log" value="" size="20" tabindex="1"    /></label>

<label>Password: <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>

<label class="submit">

<input type="submit" name="submit" id="submit" value="Login &raquo;" tabindex="3" />
<input type="hidden" name="redirect_to" value="wp-admin/" />

</form>

</div>
0
votes

you might be interested in a blog post about building a customized login form, I recently wrote.

It describes how to include a custom login form in any template, how to change the custom output and how to handle redirects after successfull/failed/empty login.

The WordPress-API functions/hooks involved are:

wp_login_form, authenticate and wp_login_failed