0
我需要一些幫助來顯示特定用戶的特定內容。期望類似於下面的內容如何在wordpress中添加基於登錄用戶的條件?
if(is_username('john')
{
$echo 'Welcome john. You are from india.';
} else {
$echo 'You have no rights to access this page...';
}
它應該僅通過用戶名(文本)而不是通過user_id或任何整數來檢查條件。可能??
使用[get_currentuserinfo()](http://codex.wordpress.org/Function_Reference/get_currentuserinfo)然後比較'$ current_user-> user_login'的用戶名要檢查對於。 – Last1Here
@ Last1Here感謝:) – Umar
我發現這從那裏,它的工作:)'<?php if($ current_user-> user_login =='the_username'){?> <! - 歡迎用戶或顯示頁面內容 - >
歡迎 user_firstname>
走開!
' – Umar