2016-10-23 59 views
0

我在這裏做什麼錯爲什麼生活的CSS不工作。活的CSS不生成

我參考了從這裏https://codex.wordpress.org/Theme_Customization_API但它並沒有爲我工作

 //adding nav color controlller 
     $wp_customize->add_section('nav_color',array(
      'title' => __('Style Navigation','dgthemecustomizer'), 
      'panel' => 'DG_COLOR_STYLING', 
      'prority' => '10' 
     )); 

     $wp_customize->add_setting('nav_color',array(
       'default' => '#FFFFFF', 
       'transport' => 'refresh' 
     )); 

     $wp_customize->add_control(
       new WP_Customize_Color_Control($wp_customize,'nav_color',array(
        'label'  => __('Navigation Background', 'DG_theme_customizer'), 
        'section' => 'nav_color', 
        'settings' => 'nav_color', 
        'context' => 'Navigation Background' 
      )) 
     ); 

     //function for making custom style work 

     function custom_color_scheme(){ 
     ?> 
      <style type="text/css"> 
       header{ 
       background: #<?php echo get_theme_mod('nav_color'); ?>; 
       } 
      </style> 
     <?php } 

     add_action('wp_head', 'custom_color_scheme'); 
     ?> 

回答