PDA

View Full Version : مبتدی: کد برای پنهان کردن اطلاعات Login وردپرس



f_talebi
پنج شنبه 06 اسفند 1394, 06:01 صبح
سلام . من کدی میخوام که اگه کاربری ب سایت وردپرسی من Log in کرد این قسمت قرمز نمایش داده نشه :

139274

کدهای ورود هم اینا هستن :


<div id="login-div">
<? if(is_user_logged_in()): ?><ul id="wp-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu">

<li id="wp-admin-bar-my-account" class="menupop with-avatar">
<a class="ab-item" aria-haspopup="true" href="http://wp-admin/profile.php" title="حساب من">
<a class="ab-item" tabindex="-1" href="http://wp-admin/profile.php">
<img alt="" src="http://0.gravatar.com/avatar/8dfce6db7d6740c484dda9e5c41f4b15?s=64&amp;d=http%3A%2F %2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435ac c9bb6523536%3Fs%3D64&amp;r=G" class="avatar avatar-64 photo" height="64" width="64">
<span class="display-name"><?php
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo ' درود ' . $current_user->user_login . '<br />';


?></span></a> </a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-user-actions" class="ab-submenu">
<li class="" id="wp-admin-bar-user-info"> </li>
<li class="" id="wp-admin-bar-edit-profile"><a class="ab-item" href="http://wp-admin/profile.php">ویرایش شناسنامه‌ی من</a> </li>
<li class="" id="wp-admin-bar-logout"><a class="ab-item" href="http://wp-login.php?action=logout&amp;_wpnonce=f3923c6d5d">بیرون رفتن</a> </li></ul></div> </li></ul>
<? wp_get_current_user(); ?><? endif; ?>


<!-- not logined -->
<? if(!is_user_logged_in()) : ?> <form name="loginform" id="loginform" action="http://wp-login.php" method="post">
<table>
<tr>
<td><label for="user_login">نام کاربری:</td>
<td><input name="log" id="user_login" class="input txt-log" size="20" type="text"></label></td>
</tr>
<tr>
<td><label for="user_pass">رمز عبور:</td>
<td><input name="pwd" id="user_pass" class="input txt-log" value="" size="20" type="password"></label> </td>
</tr>
</table>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" id="rememberme" value="forever" type="checkbox"> مرا به خاطر بسپار</label></p>
<p class="submit">
<input name="wp-submit" id="wp-submit" class="button button-primary button-large" value="ورود" type="submit">
<input name="redirect_to" value="http://wordpress/" type="hidden">
<input name="testcookie" value="1" type="hidden">

<a href="http://wp-login.php?action=register" class="button">ثبت نام</a>
<br><a href="http://wp-login.php?action=lostpassword" title="گم شدن و پیدا کردن رمز">فراموشی رمز عبور؟</a>


</p>
</form> <? endif; ?>


یه جای کار ایراد داره اگر کسی وارد هست ممنون میشم کمک کنید

f_talebi
شنبه 08 اسفند 1394, 09:58 صبح
یه زمانی سوال میشد چند نفر فورا جواب میدادن حالا که مدیران بیشتر شدن کسی جواب نمیده. :متفکر:

دانیال دزفولی
یک شنبه 09 اسفند 1394, 07:52 صبح
از همون تابع اول استفاده کنید دیگه



<?
if(!is_user_logged_in()):
echo "vared nashode id !";
endif;



if(is_user_logged_in()):
echo "vared shode id !";
endif;



?>