<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Resources 4 Bloggers &#187; add_custom_image_header</title>
	<atom:link href="http://www.resources4bloggers.com/tag/add_custom_image_header/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.resources4bloggers.com</link>
	<description>Help, Guidance &#38; Advice for Bloggers</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:23:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Wordpress Theme Control Panel to Change the Site Logo</title>
		<link>http://www.resources4bloggers.com/a-wordpress-theme-control-panel-to-change-the-site-logo/</link>
		<comments>http://www.resources4bloggers.com/a-wordpress-theme-control-panel-to-change-the-site-logo/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 10:07:33 +0000</pubDate>
		<dc:creator>DaveD</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[add_custom_image_header]]></category>
		<category><![CDATA[Control Panel]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://resources4bloggers.com/?p=139</guid>
		<description><![CDATA[You may wish to change the Banner Logo on your theme via the Wordpress WP-Admin. This service aims to allow our customers to do as much for themselves once we've got them up and running; this includes the ability to add the banner logo (at the top of each page) via WP-Admin Appearance Tab.  We made use of the add_custom_image_header function built into Wordpress!]]></description>
			<content:encoded><![CDATA[<h3>You may wish to change the Banner Logo on your theme via the Wordpress WP-Admin.  Why? It&#8217;s easier! Especially if you&#8217;re a theme designer who wans to give their users an easy way of managing their site.</h3>
<p>It is used as the foundation theme of our <a href="http://www.thewebservicescompany.co.uk" target="_blank">&#8220;£799 Website&#8221;</a> offering. This service aims to allow our customers to do as much for themselves once we&#8217;ve got them up and running; this includes the ability to add the banner logo (at the top of each page) via WP-Admin Appearance Tab.  We made use of the <code>add_custom_image_header</code> function built into Wordpress!</p>
<h3>So how did we add this functionality?</h3>
<p><em><span style="text-decoration: underline;"><strong>Before we tell you, there are some prerequisites: always back-up the files you are editing!</strong></span></em></p>
<p>Done? Let&#8217;s continue&#8230;</p>
<h3>Step One FUNCTIONS.PHP</h3>
<p>In your theme&#8217;s directory, open <code>functions.php</code></p>
<p>Scroll down to the bottom of the file and find the last line &#8211; it should be <code>?&gt;</code> which tells the software that the PHP code has finished.</p>
<p>Immediately above it paste&#8230;</p>
<pre><code>// Admin Panel
//HEADER
//  Set some default values
define('HEADER_TEXTCOLOR', 'ff6700');//  Default text color
define('HEADER_IMAGE', '%s/images/main-logo.png');  // %s is theme dir uri, set a default image
define('HEADER_IMAGE_WIDTH', 960); //  Default image width is actually the div's width
define('HEADER_IMAGE_HEIGHT', 178);  // Same for height
function header_style() {
//  This function defines the style for the theme
//  You can change these selectors to match your theme
?&gt;
&lt;style type="text/css"&gt;
#logo{
background: url(&lt;?php header_image() ?&gt;) no-repeat;
width: 960px;
height: 178px;
margin: 0 0;
padding: 0 0;
}
&lt;?php if ( 'blank' == get_header_textcolor() ) { ?&gt;
#logo h1, #logo #desc {
display: none;
}
&lt;?php } else { ?&gt;
#logo h1 a, #desc {
color:#&lt;?php header_textcolor() ?&gt;;
}
#desc {
margin-right: 30px;
}
&lt;?php } ?&gt;
&lt;/style&gt;
&lt;?php
}

function admin_header_style() {
?&gt;
&lt;style type="text/css"&gt;
#headimg{
background: url(&lt;?php header_image() ?&gt;) no-repeat;
height: &lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;px;
width:&lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;px;
padding:0 0 0 18px;
}

#headimg h1{
padding-top:40px;
margin: 0;
}
#headimg h1 a{
color:#&lt;?php header_textcolor() ?&gt;;
text-decoration: none;
border-bottom: none;
}
#headimg #desc{
color:#&lt;?php header_textcolor() ?&gt;;
font-size:1em;
margin-top:-0.5em;
}

#desc {
display: none;
}

&lt;?php if ( 'blank' == get_header_textcolor() ) { ?&gt;
#headimg h1, #headimg #desc {
display: none;
}
#headimg h1 a, #headimg #desc {
color:#&lt;?php echo HEADER_TEXTCOLOR ?&gt;;
}
&lt;?php } ?&gt;

&lt;/style&gt;
&lt;?php
}
add_custom_image_header('header_style', 'admin_header_style');

</code></pre>
<h3>Step Two HEADER.PHP</h3>
<p>Our example places a head with the diminesions 960 x 178 pixels as the banner logo.</p>
<p>Open up <code>header.php</code> and search for where the logo is <em>manually</em> programmed into the file and replace it with</p>
<pre> &lt;h1&gt;&lt;a href="&lt;?php bloginfo('url'); ?&gt;"&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;/h1&gt;</pre>
<p>Why? Well if your don&#8217;t upload a logo, then at least you&#8217;ll have the text information about your blog displayed!</p>
<h3>Step Three &#8211; Apply the Changes</h3>
<p>Once functions.php and header.php are saved, ensure you original backup copies are safe and upload them, via your favourite FTP Client, to your theme directory.</p>
<p>Log-off your site and go back into WP-Admin and the Appearance Tab should have a new sub-tab called Custom Header.</p>
<p><span style="text-decoration: underline;"><strong><em>This is where you can upload that banner image! </em></strong><em><strong>It&#8217;s all as simple as that!</strong></em></span></p>
<p><em><p>Technorati Tags: <a href="http://technorati.com/tag/Wordpress" rel="tag">Wordpress</a>, <a href="http://technorati.com/tag/WP-Admin" rel="tag"> WP-Admin</a>, <a href="http://technorati.com/tag/Change+banner" rel="tag"> Change banner</a>, <a href="http://technorati.com/tag/%3C%2Fem%3E%3Ccode%3Eadd_custom_image_header" rel="tag"> </em><code>add_custom_image_header</a></p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.resources4bloggers.com/a-wordpress-theme-control-panel-to-change-the-site-logo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
