2013-02-09 58 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');