This is completely off the subject of jazz, but I thought someone might appreciate it.

If you want to adjust your login and registration screens, put them into your website so they don’t confuse visitors, and keep your visitors away from the Wordpress admin screens, you have your work cut out for you.

There is very little help online. I know because I have looked exhaustively. I’ll take the problems one by one.

ADJUST LOGIN SCREENS

The file you’ll be altering is the wp-login.php file in the root of the website. You might have noticed that when you click on a login link on your site, you leave the site and go to an ugly Wordpress login that looks nothing like your site. You could alter the look of the login form, but it will still be isolated and most likely confuse the average person.

The first step to make the login screen more usable to to adjust the forms that are related to various login and registration functions.

Let me explain what I mean. Let’s say you forget your password. You click on the login button and get taken to a login form. In the bottom of the login form will be a link for you to recover your password. If you click on the link, in your browser there will be something like “http://weight-loss-tipster.com/wp-login.php?action=lostpassword”. The key part of that is “wp-login.php?action=lostpassword”. That takes you to a form in wp-login.php. Another example is if you click on the link to register. That one looks like this in the URL window: “http://weight-loss-tipster.com/wp-login.php?action=register” and corresponds to a different form in wp-login.php.

There are several forms contained in wp-login.php. Here’s the first one:

login_header(__(’Lost Password’), ‘
<p class=”message”>’ . __(’Please enter your username or e-mail address. You will receive a new password via e-mail. <strong>If you do not find the email in your inbox, you may need to check your junk mail folder.</strong>’) . ‘</p>
‘, $errors);
?&gt;

<form id=”lostpasswordform” action=”wp-login.php?action=lostpassword” accept-charset=”UNKNOWN” enctype=”application/x-www-form-urlencoded” method=”post”>  <label><strong><!–p _e(’Username or E-mail:’)–></strong>

  <input id=”user_login” class=”input” maxlength=”2147483647″ name=”user_login” size=”20″ type=”text” value=”&lt;?php echo attribute_escape(stripslashes($_POST[’user_login’])); ?&gt;” /></label> 

<!–p do_action(’lostpassword_form’);–>
<p class=”submit”><input id=”wp-submit” maxlength=”2147483647″ name=”wp-submit” size=”20″ type=”submit” value=”&lt;?php _e(’Get New Password’); ?&gt;” /></p>

</form>

Notice that I’ve changed the text at the top to include instructions about junk mail. What you need to do is go through wp-login.php and make the changes to the forms that you need.

PUTTING THE FORM IN YOUR WEBSITE

Now that we’ve changed the forms to our liking, how do you put them inside your website instead of all by themselves? To understand the solution, you need to understand how Wordpress builds a page. Don’t worry, I won’t get technical on you. Basically, it puts in the header, then the middle section, the right column, and so on. In order to put the login page within your website, you have to tell Wordpress to do so.

This is how you do it, create a php file called login.php, and put it in your theme folder. Here’s some sample code:

<?php
/**
 * defines custom login header and footer to provide a themed login page
 */
// Rather than duplicating this HTML all over the place, we’ll stick it in function
function login_header($title = ‘Login’, $message = ”, $wp_error = ”) {
 get_header();
 include(TEMPLATEPATH.”/r_sidebar.php”);
 ?>
 <div id=”contentmiddle”>
<div id=”login”><h2><?php echo $title ?></h2>
<?php
 login_header_error($message, $wp_error);
} // End of login_header()

function login_footer() {
?>
 </div>
<?php
 get_footer();
}
?>

Of course, depending on how your page is structured, your code will probably be a little different.

HOW TO CREATE LOGIN AND REGISTER LINKS

Now, some of you might be wondering how to create login and register links, say in a sidebar. I’m not going to give you my solution because it has been adjusted for my particular situation. I’m going to give you the solution from WPDesigner.com. I’d just direct you to the site, but there’s always the possibility the solution will be taken down, so I’m including it here. Just make the changes you want, stick it in your sidebar (or wherever else you might want it on your site) and you’re good to go:

<li>
<?php global $user_ID, $user_identity, $user_level ?>
<?php if ( $user_ID ) : ?>
<h2>Control panel</h2>
<ul>
<li>Identified as <strong><?php echo $user_identity ?></strong>.
<ul>
<li><a href=”<?php bloginfo(’url’) ?>/wp-admin/”>Dashboard</a></li>

<?php if ( $user_level >= 1 ) : ?>
<li><a href=”<?php bloginfo(’url’) ?>/wp-admin/post-new.php”>Write an article</a></li>
<?php endif // $user_level >= 1 ?>

<li><a href=”<?php bloginfo(’url’) ?>/wp-admin/profile.php”>Profile and personal options</a></li>
<li><a href=”<?php bloginfo(’url’) ?>/wp-login.php?action=logout&amp;redirect_to=<?php echo urlencode($_SERVER[’REQUEST_URI’]) ?>”>Exit</a></li>
</ul>
</li>
</ul>

<?php elseif ( get_option(’users_can_register’) ) : ?>

<h2>Identification</h2>
<ul>
<li>
<form action=”<?php bloginfo(’url’) ?>/wp-login.php” method=”post”>
<p>
<label for=”log”><input type=”text” name=”log” id=”log” value=”<?php echo wp_specialchars(stripslashes($user_login), 1) ?>” size=”22″ /> User</label><br />
<label for=”pwd”><input type=”password” name=”pwd” id=”pwd” size=”22″ /> Password</label><br />
<input type=”submit” name=”submit” value=”Send” class=”button” />
<label for=”rememberme”><input name=”rememberme” id=”rememberme” type=”checkbox” checked=”checked” value=”forever” /> Remember me</label><br />
</p>
<input type=”hidden” name=”redirect_to” value=”<?php echo $_SERVER[’REQUEST_URI’]; ?>”/>
</form>
</li>

<li><a href=”<?php bloginfo(’url’) ?>/wp-register.php”>Register</a></li>
<li><a href=”<?php bloginfo(’url’) ?>/wp-login.php?action=lostpassword”>Recover password</a></li>
</ul>

<?php endif // get_option(’users_can_register’) ?>

</li>

Hope this helps!


If you found this post helpful, share it by clicking on one of these icons!


[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]




Related posts:
Comments

Name (required)

Email (required)

Website

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share your wisdom


  • Topics

  • Recent Posts