نمایش فرم ورود در قالب وردپرس

  • نویسنده موضوع MR.WP
  • تاریخ شروع

MR.WP

مدیر انجمن وردپرس
امروز برای ورود به بخش کاربری از فرم ورود استفاده میکنیمبرای این کار کافیست در هرجای قالب (مثل سایدبار , هدر , ایندکس و … ) که میخواهید کد زیر را قرار دهید :


کد:
<<?php if[COLOR=#555555][FONT=Consolas] [/FONT][/COLOR](!(current_user_can('level_0'))){ ?>
[COLOR=#555555][FONT=Consolas]<h2>Login</h2>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<form action="<?php echo get_option('home'); ?>/wp-login.php" method="post">[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<input type="password" name="pwd" id="pwd" size="20" />[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<input type="submit" name="submit" value="Send" class="button" />[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]    <p>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]       <label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]       <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]    </p>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]</form>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password</a>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<?php } else { ?>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<h2>Logout</h2>[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<a href="<?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?>">logout</a><br />[/FONT][/COLOR]
[COLOR=#555555][FONT=Consolas]<a href="[URL]http://xxx/wp-admin/[/URL]">admin</a>[/FONT][/COLOR]
[COLOR=black][FONT=Consolas]<?php }?>
[/FONT][/COLOR]


خیلی ساده اما کاربردی ! موفق و وردپرسی باشید

لینک منبع :

 
بالا