admin管理员组文章数量:1417442
I want to change the color of the protected post titles. When a post is in protected status (have password), the post title will turn red different from other posts. Please help me, thanks.
I want to change the color of the protected post titles. When a post is in protected status (have password), the post title will turn red different from other posts. Please help me, thanks.
Share Improve this question edited Aug 6, 2019 at 19:16 RiddleMeThis 3,8078 gold badges22 silver badges30 bronze badges asked Aug 6, 2019 at 18:49 Duy HữuDuy Hữu 195 bronze badges 01 Answer
Reset to default 1To change the color of password protected post titles in the admin
In your theme or child theme, enqueue a stylesheet to load in the admin, then add some simple CSS to change the color using the class that is given to password protected posts.
In your theme's functions.php...
function wpse_admin_styles(){
wp_enqueue_style(
'admin_css',
get_stylesheet_directory_uri() . '/css/admin-styles.css', array(), filemtime( get_stylesheet_directory() . '/css/admin-styles.css')
);
}
add_action('admin_enqueue_scripts', 'wpse_admin_styles');
Create a css
directory in your theme, add the admin-styles.css and paste in the following CSS...
.post-password-required .row-title {
color: red;
}
To change the color of password protected post titles on the frontend
In your theme or child theme add the following to your CSS files, or add it directly in Appearance > Customize > Additional CSS
. It uses a class added to the article tag.
.post-password-required .entry-title {
color: red;
}
Note - This may vary from theme to theme but should give you a good idea of how to do it.
本文标签: wp adminChange the color of the Password Protected Post titles
版权声明:本文标题:wp admin - Change the color of the Password Protected Post titles 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745264019a2650486.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论