I want to add some CSS for everyone except site admin. Any guidance? Thanks.
Hi There,
You should install and activate the child theme first: https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57.
After that add this code under functions.php
file locates in your child theme:
function print_custom_css() {
if(!current_user_can( 'administrator' )){
?>
<style type="text/css">
body {
font-size: 24px;
}
p {
margin-bottom: 15px;
}
</style>
<?php
}
}
add_action( 'wp_head', 'print_custom_css' );
You can replace this CSS with your custom CSS:
body {
font-size: 24px;
}
p {
margin-bottom: 15px;
}
Hope it helps
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.