你用错了钩子,你用错了方法。很抱歉澄清。
在页脚中添加样式表根本不是好的样式,而是初学者的错误。Have a look at loading scripts correctly.
您需要将该样式规则添加到登录页面/挂钩的html头部。
由于要编辑登录表单,因此需要使用的正确挂钩是login_head
参见法典:Login Hooks
另请参见:Login Head
类似以下内容(functions.php):
function se_css_output_hide_promt() { ?>
<style type="text/css" id="se-answer-customized-css">
<?php
//switch to php to check the login status, add css when true
if(is_user_logged_in()): ?>
.app { display: none!important; }
<?php endif; ?>
</style>
<?php }
add_action(\'login_head\', \'se_css_output_hide_promt\');
我敢打赌!如果你这样做,就不再需要“重要”。此css将在结尾之前添加
html-head, 非常接近您的html。意思是你的!可能不再需要“重要”。