login form display
-
This might not be the correction location, move topic if necessary.
I am trying to create a login form at the top of the main page.
I am using the following code:
<?php if (!is_user_logged_in()) { echo "Hello there, Guest..."; <form action="wp-login.php" method="post"> Username: <input type="text" name="log" id="user_login" class="input" /> Password:<input type="password" name="pwd" id="user_pass" class="input" /> <input type="hidden" name="testcookie" value="1" /> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember Me <input type="submit" name="wp-submit" id="wp-submit" value="Log In" /> </form> else { echo "Welcome back, username. Logout."; } ?>However, when looking at the main page, I get an error:
Parse error: syntax error, unexpected '<' in /site url/ on line 5Can anyone see what I have done wrong?
What I want is if a user is logged in, then display the admin links etc.. else if user is not logged in display the login form.I have tried unsuccessfully to get this working and i have searched on the forum but nothing seems to help.
Thank you in advance.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘login form display’ is closed to new replies.