<?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>memeLab &#187; customisation</title>
	<atom:link href="http://memelab.com.au/tag/customisation/feed/" rel="self" type="application/rss+xml" />
	<link>http://memelab.com.au</link>
	<description>Search Engine Marketing and Web Publishing Services</description>
	<lastBuildDate>Tue, 06 Dec 2011 11:57:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Custom Admin Branding: code update</title>
		<link>http://memelab.com.au/custom-admin-branding/</link>
		<comments>http://memelab.com.au/custom-admin-branding/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 13:07:12 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Custom Admin Branding]]></category>
		<category><![CDATA[customisation]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://memelab.com.au/?p=140</guid>
		<description><![CDATA[<p><p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>I love the WordPress plugin Custom Admin Branding by Josh Byers..  who doesn&#8217;t love seeing their shiny, official name at the top of their admin panel? I noticed, though, that when when I updated the plugin to 1.3.5, my custom files were overwritten.. Doh!  It defeats the purpose of auto-update if we have to resurrect [...]</p></p><p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>I love the WordPress plugin <a title="Download the plugin from WordPress.org" href="http://wordpress.org/extend/plugins/custom-admin-branding" target="_blank">Custom Admin Branding</a> by <a title="Josh Byers, author of the Custom Admin Branding" href="http://pressingpixels.com/wordpress-custom-admin-branding" target="_blank">Josh Byers</a>..  who doesn&#8217;t love seeing their shiny, official name at the top of their admin panel?</p>
<p>I noticed, though, that when when I updated the plugin to 1.3.5, my custom files were overwritten.. Doh!  It defeats the purpose of auto-update if we have to resurrect our settings afterwards, clearly, but every journey progresses one step at a time, and I&#8217;ve been rapt to have such a great plugin, complete with annotated photoshop templates.<span id="more-140"></span></p>
<p>Still, it would be great if the custom files survived an update, so I&#8217;ve had a fiddle, and come up with a crude solution&#8230; and while I was at it, I&#8217;ve added an option to change the Header background colour (which is simpler than using the custom stylesheet which is currently an option hidden in the code of the plugin).</p>
<p>I&#8217;m hoping that he&#8217;ll like the changes, and we might get another update soon!</p>
<p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></content:encoded>
			<wfw:commentRss>http://memelab.com.au/custom-admin-branding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Header Image for WordPress Themes</title>
		<link>http://memelab.com.au/custom-header-image-for-wordpress-themes/</link>
		<comments>http://memelab.com.au/custom-header-image-for-wordpress-themes/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 03:38:06 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[customisation]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[theme design]]></category>

		<guid isPermaLink="false">http://memelab.com.au/?p=71</guid>
		<description><![CDATA[<p><p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>A client wanted to be able to set a different header image for each page or post on his WordPress site, so I&#8217;ve written this function for him. He can now set a custom image for each page header in a few steps: upload the cropped custom images via FTP set the custom field &#8220;header&#8221; [...]</p></p><p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>A client wanted to be able to set a different header image for each page or post on his WordPress site, so I&#8217;ve written this function for him.</p>
<p>He can now set a custom image for each page header in a few steps:</p>
<ul>
<li>upload the cropped custom images via FTP</li>
<li>set the custom field &#8220;header&#8221; in the relevant posts</li>
</ul>
<p><span id="more-71"></span></p>
<h3>Set up..</h3>
<p>You&#8217;ll need to create the folder /wp-content/uploads/<strong>header</strong>/ and upload your default image into it.</p>
<p>The following function belongs in your theme&#8217;s <strong>functions.php</strong> file (you can create it if it doens&#8217;t already exist).  You&#8217;ll also need to check that your theme includes the wordpress function <strong>wp_head()</strong> in your <strong>header.php</strong> file.</p>
<p>Change the value <strong>my_default_image.jpg</strong> to the name of the file you uploaded.  <em>Tip: for simplicity&#8217;s sake, don&#8217;t use spaces in the filename.</em></p>
<pre class="php" name="code">function get_custom_header() {

	global $post;

	$error_level	 = error_reporting();
	$default_folder	 = "/wp-content/uploads/header/";
	$default_image	 = "my_default_image.jpg";
	$header		 = get_post_meta($post-&gt;ID, 'header', true);
	$file		 = ABSPATH.$default_folder.$header;

	// if nothing is defined, use the default
	$header_image	 = $default_image;

	// is the field defined?
	if($header != '')

		// does the file exist?
		if(file_exists($file)) {

			// getimagesize() returns an error if the file is not an image.. keep it quiet
			error_reporting(0);

			// is it really an image?
			if(getimagesize($file))
				$header_image = $header;

			error_reporting($error_level);
		}

	print "\n\n&lt;!-- Custom Header Image by http://memeLab.com.au --&gt;\n";
	print "&lt;style&gt;&lt;!-- #logo {background: url(" . $default_folder . $header_image . ") no-repeat left top;} --&gt;&lt;/style&gt;\n\n";
}
add_action('wp_head', 'get_custom_header');</pre>
<h3>What it does:</h3>
<p>The function:</p>
<ul>
<li>checks whether a custom image was set</li>
<li>ensures that the file exists, and is actually an image</li>
<li>only sets the custom header if both of these conditions is true</li>
</ul>
<p>The challenge here was in testing to see if the file was an image: the best php functions for the job are probably finfo() or exif_imagetype(), but they weren&#8217;t available on my client&#8217;s server, so I used getimagesize() instead.  Unfortunately, getimagesize() prints a warning rather than returning an errorcode if the file is not an imageimage, so I silenced the possible warning by setting then restoring error_reporting().</p>
<p>Of course, it can be said that a production server shouldn&#8217;t print errors, but that wasn&#8217;t my call here.</p>
<p>This function was developed for WordPress 2.6.3, but should run fine on anything after 2.5.1.</p>
<p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></content:encoded>
			<wfw:commentRss>http://memelab.com.au/custom-header-image-for-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

