I am having an issue trying to configure the theme I am working on to allow the footer color to be changed. So far all of my other options work so I am geussing it is an issue with the way I am calling back to the css class.

This is the footer class:

 .footer {
 background: #f7f7f7;
 height: 150px;
 position: relative;
 z-index: 7;
 -webkit-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
 -moz-box-shadow: 0 2px 20px rgba(0,0,0,0.4);
 -ms-box-shadow: 0 2px 20px rgba(0,0,0,0.4);
 -o-box-shadow: 0 2px 20px rgba(0,0,0,0.4);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);


This is how I am calling it from the theme:

 function theme_header_css() {


       .footer {
        background: <?php echo my_theme_mod( 'hero_footer_color' ); ?>;


  add_action( 'wp_head', 'theme_header_css' );

I tried calling background-color instead of background but that doesn't seem to work. I am thinking that I am not calling the class right. Can anyone give me a hand?

EDIT: When I check the page CSS I can see that it is attempting to override the background color, although it is not producing a value and appears like this:

.footer { background: ; }

After checking through multiple times it is the proper setting, so I am at a loss to what it is, if it is not the CSS.

Here is get_theme_mods()

 function my_get_theme_mods() {
$defaults = array(      
    'my_hero_title'                 => '',
    'my_hero_description'           => '',      
    'my_hero_background_color'      => '#17649a',
    'my_hero_background_image'      => '',
    'my_hero_background_repeat'     => 'no-repeat',
    'my_hero_background_position'   => 'center',        
    'my_footer_color'               => '#f7f7f7',

return $defaults;
  • 1
    It's hard to say what the problem might be without seeing my_theme_mod() at least. – vancoder Apr 17 '13 at 21:49
  • does the style code appear in the head section? – Michael Apr 17 '13 at 23:39
  • Perhaps instead of 'my_theme_mod' you should try the get_theme_nod() function? – WPMU-DEV Ari Apr 18 '13 at 13:48
  • Thanks for the suggestions I have made an addition to my post, Michael, no the style isn't in the head section. @WPMU-DEVAri Ari - I have just tried that with the same outcome. I am going to add in the my_theme_mod settings into my post. – user1632018 Apr 18 '13 at 14:32
  • @vancoder , Thanks I have added in the my_theme_mod. – user1632018 Apr 18 '13 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.