title: Wordpress Customize Image Control Not Working
body: <p>I am currently creating a Wordpress theme and I have run into a snag. I'm using the theme customize page to upload a main logo and a mobile logo. Those logo's should then be used on the page. I got it to work for twenty minutes but them it stopped working.</p>
  
  <p>Here is my customize register function in function.php:</p>
  
  <pre><code>function wpalpha_customize_register( $wp_customize ) {
  
    $wp_customize-&gt;add_section( 'wpalpha_logo_section' , array(
      'title'                 =&gt;  __('Logos', 'wpalpha'),
      'description'           =&gt;  __('Upload logos to replace the default site logos.'),
      'panel'                 =&gt;  'design_settings',
      'priority'              =&gt;  10,
      'capability'            =&gt;  'edit_theme_options',
      'theme_supports'        =&gt;  '',
    ) );
  
    $wp_customize-&gt;add_setting('wpalpha_desktop_logo', array(
      'type'                  =&gt;  'theme_mod',
      'capability'            =&gt;  'edit_theme_options',
      'theme_supports'        =&gt;  '',
      'default'               =&gt;  get_template_directory_uri().'/img/header/shield_text.png',
      'sanitize_callback'     =&gt;  '',
      'sanitize_js_callback'  =&gt;  '',
      'transport'             =&gt;  'refresh',
    ));
    $wp_customize-&gt;add_control(new WP_Customize_Image_Control($wp_customize, 'wpalpha_desktop_logo', array(
      'label'                 =&gt;  __('Choose Logo', 'wpalpha'),
      'section'               =&gt;  'wpalpha_logo_section',
      'settings'              =&gt;  'wpalpha_desktop_logo',
      'context'               =&gt;  'wpalpha-desktop-logo',
    )));
  
    $wp_customize-&gt;add_setting('wpalpha_mobile_logo', array(
      'type'                  =&gt;  'theme_mod',
      'capability'            =&gt;  'edit_theme_options',
      'theme_supports'        =&gt;  '',
      'default'               =&gt;  get_template_directory_uri().'/img/header/shield.png',
      'sanitize_callback'     =&gt;  '',
      'sanitize_js_callback'  =&gt;  '',
      'transport'             =&gt;  'refresh',
    ));
    $wp_customize-&gt;add_control(new WP_Customize_Image_Control($wp_customize, 'wpalpha_mobile_logo', array(
      'label'                 =&gt;  __('Choose Logo', 'wpalpha'),
      'section'               =&gt;  'wpalpha_logo_section',
      'settings'              =&gt;  'wpalpha_mobile_logo',
      'context'               =&gt;  'wpalpha-mobile-logo',
    )));
  }
  
  add_action('customize_register', 'wpalpha_customize_register');
  </code></pre>
  
  <p>And here is where I'm using it in header.php:</p>
  
  <pre><code>&lt;a class="navbar-brand" href="&lt;?php echo home_url(); ?&gt;"&gt;
  
    &lt;?php if(get_theme_mod('wpalpha_desktop_logo') != ''): ?&gt;
    &lt;img class="desktop dlp_logo" src="&lt;?php echo esc_url(get_theme_mod('wpaplpha_desktop_logo')); ?&gt;"&gt;
    &lt;?php endif; ?&gt;
  
    &lt;?php if(get_theme_mod('wpalpha_mobile_logo') != ''): ?&gt;
    &lt;img class="mobile dlp_logo" src="&lt;?php echo esc_url(get_theme_mod('wpaplpha_mobile_logo')); ?&gt;"&gt;
    &lt;?php endif; ?&gt;
  
  &lt;/a&gt;
  </code></pre>
  
  <p>This is what my code outputs as:</p>
  
  <pre><code>&lt;img class="desktop dlp_logo" src=""&gt;
  &lt;img class="mobile dlp_logo" src=""&gt;
  </code></pre>
  
  <p>This image shows that the options work on the customize page but my logos no longer show up (The little box in the top left corner is supposed to be the logo): (Apparently I'm not good enough for this site to post a picture so you'll have follow this link...)</p>
  
  <p><a href="http://i.stack.imgur.com/C38O6.jpg" rel="nofollow">http://i.stack.imgur.com/C38O6.jpg</a></p>
  
  <p>Please help!
  Thanks</p>
  
  <p>Update #1:</p>
  
  <p>I looks like my database is no longer being updated when I change the logos on the Wordpress backend site. Am I forgetting update options? I thought that was built into these functions.</p>
  
  <p>Update #2:</p>
  
  <pre><code>&lt;?php echo var_dump(get_theme_mod('wpalpha_desktop_logo')); ?&gt;
  </code></pre>
  
  <p>This var_dump() returns 'string(82) "<a href="http://localhost:8888/wp-content/themes/adenicboy-alpha/img/header/shield_text.png" rel="nofollow">http://localhost:8888/wp-content/themes/adenicboy-alpha/img/header/shield_text.png</a>"' so I'm really confused why this isn't working...</p>