Create a custom logo option

<li><label>Logo</label>
<input  name=”logo” type=”text” value=”<?php echo get_option(‘logo’); ?>” id=”logo”/>
<input type=’button’ class=”button-primary” value=”Upload” id=”uploadimage0″/>
<img src=”<?php echo get_option(‘logo’); ?>” class=”custom-logo”>
</li>

 

$( ‘#uploadimage0’ ).on(‘click’, function() {
var placeholder = $(this);
tb_show(”, ‘media-upload.php?type=image&TB_iframe=true’);

window.send_to_editor = function( html )
{
imgurl = $( ‘img’, html ).attr( ‘src’ );
$(‘#logo’).val(imgurl);
tb_remove();
}
return false;
});

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s