There are different methods for adding custom CSS to your WordPress site. Custom CSS can be added for modify frond-end of your website or modify back-end(admin area) of your website.
Modifying website front look is most common.
Adding CSS to modify website front-end
Add following line of code in functions.php of your theme to modify CSS in front-end of website.
0
1
2
3
4
5
6
7
8
9
10
|
add_action(‘wp_head’,‘custom_css’);
function custom_css() {
$output=“<style> .entry-content { background-color : #f1f1f1; } </style>“;
echo $output;
}
|
Adding CSS to modify Admin area
Following line of code should be added in functions.php of your theme.
0
1
2
3
4
5
6
7
8
9
10
|
add_action(‘admin_head’,‘custom_admin_css’);
function custom_admin_css() {
$output=“<style> #adminmenu div.wp-menu-name { padding:8px 0;color:#76AFF3; } </style>“;
echo $output;
}
|