2013-02-09 57 views
2

我想隐藏来自仪表板的wordpress“请通知站点管理员”消息。 enter image description here 的消息是:使用CSS隐藏wordpress消息

WordPress 3.5.1 is available! Please notify the site administrator. 

HTML代码:

<div class="update-nag"><a href="http://codex.wordpress.org/Version_3.5.1">WordPress 3.5.1</a> is available! Please notify the site administrator.</div> 

所以,我添加了一些像这样的CSS来隐藏消息,但这个不工作!
这是css:

.update-nag{ 
display: none;} 

任何想法?

+0

你试过我的建议吗?我很好奇,看看它是否需要ID类名称设置为'display:none;' – 2013-02-09 10:11:26

+0

是的,我已经尝试过您的代码,但它没有工作... – 2013-02-10 15:40:26

+1

奇怪的是,我编辑时,我编辑它在检查员。谢谢你让我知道! – 2013-02-11 01:58:03

回答

2

你可以起诉该模块从Prijm发现启用模块,将做的工作:
Hide Update Reminder Message

+0

ow!得到它的工作..感谢插件! – 2013-03-07 11:38:22

1

将下面的代码放在主题functions.php文件中。

只要将这个简单的代码放在你的functions.php中,更新消息就会隐藏起来。

function hideUpdateNag() { 
    remove_action('admin_notices', 'update_nag', 3); 
} 
add_action('admin_menu','hideUpdateNag'); 
+0

nope ...不可用 – 2013-02-09 06:49:39

+0

add_action('admin_menu','wphidenag'); function wphidenag(){ 试试这个 remove_action('admin_notices','update_nag',3); } – MRaj 2013-02-09 07:34:50

+0

只需将这个简单的代码放在你的functions.php中,并且更新消息将被隐藏。 function hideUpdateNag(){ remove_action('admin_notices','update_nag',3); } add_action('admin_menu','hideUpdateNag'); – MRaj 2013-02-09 07:39:38

0

尝试:

#update-nag, .update-nag{ 
    display: none; 
} 
0

ADD_ACTION( 'admin_menu', 'wphidenag'); ()''''''''''''''''''''''''''''''''''功能wphidenag(){ remove_action('admin_notices','update_nag',3); }

试试这个

0

只是把这个简单的代码到functions.php和更新消息将被隐藏。

function hideUpdateNag() { 
    remove_action('admin_notices', 'update_nag', 3); 
} 
add_action('admin_menu','hideUpdateNag'); 
0

作为管理员,我想看到的消息,但我想它隐藏的其他用户。我这样做:

function hideUpdateNag() { 
    // if not an administrator 
    if (!current_user_can('update_core')) { 
     remove_action('admin_notices', 'update_nag', 3); 
    } 

} 
add_action('admin_menu','hideUpdateNag');