2016-02-12 26 views
1

我試圖在用戶名上方的登錄表單中添加文本。我在fuctions.php文件中嘗試了一些代碼,但在wp-login頁面的前端沒有顯示任何代碼。在wordepress登錄表單標題中添加文字

這是我創建的功能。

function filter_login_form_top_text($var) { 
// make filter magic happen here... 
$var = "Login to view the manual - into login form"; 
return $var; }; add_filter('login_form_top', 'filter_login_form_top_text', 10, 2); 

我們使用WordPress默認登錄從

我下面this鏈接進行更改

可以請人幫我做這改變

回答

0
function emqube_change_text_on_login_form($text){ 
    if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){ 
    if ($text == 'Username'){$text = 'text_you_want Username';} // for login form 
     if ($text == 'Username or Email:'){$text = 'text_you_want Username or Email:';} // for forgot password 
     } 
      return $text; 
    } add_filter('gettext', 'emqube_change_text_on_login_form'); 

我加入到取代我所需要的文本標籤文本...

0

添加到您的主題的functions.php文件在登錄表單上方添加文字:

function my_custom_login_message() { 
    return "A custom login message"; 
} 

add_filter('login_message', 'custom_login_message'); 
+0

我已經做到了,但它的到來下面的標誌我想要的用戶名標籤上面的文字。 – Chilll007