2016-02-12 27 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