WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] using wp_signon for a login form in a template

[Resolved] using wp_signon for a login form in a template

Viewing 1 replies (of 1 total)
  • I didn’t have to use wp_signon at all anyway.

    My solution was to create a login form in a template, submit the form to /wp-login.php with a redirect back to the_permalink().

    Job done!

    For those that want to know:

    if( !is_user_logged_in() ):?>
    				<div class="loginform">
    					<p>Please enter your username and password to continue</p>
    					<form method="post" action="<?php bloginfo('url') ?>/wp-login.php">
    						<div class="formbox">
    
    							<label for="user_login">Username:</label> <input type="text" name="log" id="user_login"><br />
    							<label for="user_pass">Password:</label> <input type="password" name="pwd" id="user_pass"><br />
    							<input type="hidden" name="rememberme" value="forever">
    							<input type="hidden" name="redirect_to" value="<?php the_permalink(); ?>">
    
    						</div>
    						<p><input type="image" src="<?php bloginfo('template_directory') ?>/images/login-button.gif" value="Log in" name="wp-submit">
    					</form>
    				</div>
    			<?php
    			else:
    			?>
    				<div class="pagebody">
    					<?php // the loop goes here ?>
    				</div>
    				<?php get_sidebar(); ?>
    			<?php
    			endif;

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] using wp_signon for a login form in a template’ is closed to new replies.
Skip to toolbar