Custom styles don't work, here's how to make them work
-
You have your
css/styles.php
include commented out. Hence, customizer choices for design won’t work.There’s a better, actually reliable way to include that css. Change the contents of
css/styles.php
to be something like:add_action( 'wp_head', 'uniform_add_css' ); function uniform_add_css() { $custom = '<style type="text/css">'; // Theme color $uniform_theme_color = get_theme_mod( 'uniform_theme_color', '#a0ce4e' ); if ( $uniform_theme_color != '#a0ce4e' ) { // removed all the specific rules for clarity // // ( wouldn't it be better to have a few classes // used throughout the theme? // // .uniform-theme-color { // color: $uniform_theme_color !important; // } // .uniform-theme-bgcolor { // background-color: $uniform_theme_color !important; // } // and add them as appropriate to elements? This block of // seems really fragile and a pain to maintain ) } $uniform_custom_css = get_theme_mod( 'uniform_custom_css', '' ); $custom .= $uniform_custom_css; $custom .= '</style>'; echo $custom; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom styles don't work, here's how to make them work’ is closed to new replies.