<?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>design is philosophy &#187; WordPress Themes</title>
	<atom:link href="http://www.designisphilosophy.com/category/wordpress-themes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designisphilosophy.com</link>
	<description>WordPress, Expression Web, CSS, other stuff</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:10:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.designisphilosophy.com/?pushpress=hub'/>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Day 24: Vidunder &#8211; a Free WordPress theme just for you</title>
		<link>http://www.designisphilosophy.com/tutorials/vidunder-a-free-wordpress-theme-just-for-you/</link>
		<comments>http://www.designisphilosophy.com/tutorials/vidunder-a-free-wordpress-theme-just-for-you/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 16:00:19 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[24 Days of WordPress]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=1231</guid>
		<description><![CDATA[I promised something big, and here it is. On this 24th and Last Day of WordPress (for 2010 at least) I give you the new Vidunder WordPress theme that you see running on this very blog. Download Vidunder right here! &#8230; <a href="http://www.designisphilosophy.com/tutorials/vidunder-a-free-wordpress-theme-just-for-you/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm6.static.flickr.com/5282/5287074999_d70a037605_b.jpg"><img class="alignright" title="Vidunder" src="http://farm6.static.flickr.com/5282/5287074999_d70a037605.jpg" alt="" width="272" height="500" /></a>I promised something big, and here it is. On this 24th and Last Day of WordPress (for 2010 at least) I give you the new Vidunder WordPress theme that you see running on this very blog.</p>
<p><a title="Download the Vidunder WordPress theme here" href="http://designisphilosophy.com/themes/vidunder.zip" target="_blank">Download Vidunder right here!</a></p>
<h2>More customization than you&#8217;ll ever need</h2>
<p>Vidunder (means &#8220;wonder&#8221; in Norwegian) is a Twentyten child theme that takes what Twentyten does and builds on it. There are so many customization options in this theme it&#8217;s hard to list them all but here are the highlights:</p>
<h3>Custom colours</h3>
<p>The colour scheme of Vidunder is by default orange. But you can change it to any colour you want. Simply go to Appearance -&gt; Background and change the colour. This will change the background colour as well as the link colours and some other elements.</p>
<h3>Custom logo</h3>
<p>To change the logo go to Appearance -&gt; Header and upload your own. The logo is 87 x 87px and if you want a transparent logo like the one you&#8217;re seeing here you need to upload a PNG of exactly that size. If you don&#8217;t care about transparency you can upload any image file and WordPress will help crop it to size for you.</p>
<h3>Twitter updates in the header</h3>
<p><img class="alignright size-full wp-image-1232" title="twitter" src="http://www.designisphilosophy.com/wp-content/uploads/2010/12/twitter.jpg" alt="" width="339" height="105" />To activate Twitter updates in the header go to Settings -&gt; General, scroll to the bottom and enter your Twitter handle. The theme will go to Twitter, get your latest tweet and display it in the header for you.</p>
<h3>Custom header image</h3>
<p>Using the Appearance -&gt; Background setting you can also upload a custom header image of your choosing. This is independent of the custom colours.</p>
<h3>Custom Author Box</h3>
<div id="attachment_1240" class="wp-caption alignleft" style="width: 577px"><a href="http://www.designisphilosophy.com/wp-content/uploads/2010/12/author.jpg"><img class="size-full wp-image-1240" title="Custom Author Box and Related Posts" src="http://www.designisphilosophy.com/wp-content/uploads/2010/12/author.jpg" alt="" width="567" height="489" /></a><p class="wp-caption-text">Custom Author Box and Related Posts</p></div>
<p>To display the Custom Author Box underneath single posts go to Users -&gt; My Profile and define your name, email address, website, bio and Twitter handle (yes, Twitter handle). The author box will grab your Gravatar and display it along with your info. If you don&#8217;t have a bio defined the Custom Author Box will not show.</p>
<h3>Related Posts</h3>
<p>If there are two or more posts in the current category the two latest ones will be displayed under the current post. The Custom Author Box and the Related Posts box can be hidden by the viewer by clicking the Hide button in the top right corner.</p>
<h3>Sidebars Gallore</h3>
<p>The theme features 9 widgetized areas. In addition to the standard twentyten areas there is Custom which is a full-width area jammed up against the header. You can see it displaying the graphic ads for my books and video series here. Use it with causion. In addition there are Left and Right. Experiment at your own leisure.</p>
<h2>And last, but not least&#8230;</h2>
<p><a title="Download the Vidunder WordPress theme here" href="http://designisphilosophy.com/themes/vidunder.zip" target="_blank">Download Vidunder right here!</a></p>
<p>God Jul og Godt Nytt År!</p>
<p>Now go install Vidunder, mess around with the settings and get your WordPress site going for the new year!</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/vidunder-a-free-wordpress-theme-just-for-you/' addthis:title='Day 24: Vidunder &#8211; a Free WordPress theme just for you' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/vidunder-a-free-wordpress-theme-just-for-you/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What would you want in the perfect WordPress photo theme?</title>
		<link>http://www.designisphilosophy.com/wordpress-as-cms/what-would-you-want-in-the-perfect-wordpress-photo-theme/</link>
		<comments>http://www.designisphilosophy.com/wordpress-as-cms/what-would-you-want-in-the-perfect-wordpress-photo-theme/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 23:23:58 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=894</guid>
		<description><![CDATA[After having finished a myriad of enormously time consuming projects I have decided I need to do something just for fun. So I&#8217;m going to build an advanced (and free) WordPress theme for photographers. I&#8217;ve noticed over the last couple &#8230; <a href="http://www.designisphilosophy.com/wordpress-as-cms/what-would-you-want-in-the-perfect-wordpress-photo-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After having finished a myriad of enormously time consuming projects I have decided I need to do something just for fun. So I&#8217;m going to build an advanced (and free) WordPress theme for photographers. I&#8217;ve noticed over the last couple of years that photographers really love WordPress but that the themes out there, great as they are, are quite inflexible and uniform. As a result a lot of photographers go out and buy a premium theme customized for photographers and advertised as being the greatest thing since the SLR only to realize they are just clunky and inflexible WordPress themes built on top of other clunky and inflexible free themes. So, because I have a lot of photographer friends and because I like building WordPress themes I&#8217;m going to build a rock solid WordPress theme specifically for photographers that has tons of customizability and functionality built in.</p>
<h3>Have your say: What would the ideal WordPress theme for photographers look like?</h3>
<p>I&#8217;m a photographer myself, but since I don&#8217;t actually sell my photography services I have chosen not to have a dedicated site for it. Therefore I am not the ideal person to make a list of what the perfect or ideal WordPress photo theme should do in terms of functionality, customizability and integration. So instead of making a list myself only to realize I left out all the important stuff I&#8217;m asking you point blank what you want.</p>
<p>Go to the comments below and give me your dreams, desires and crazy ideas for what a photography WordPress theme should and could do and I&#8217;ll bundle it all up and see if I can incorporate all of, or as much as possible of it into the new theme. Think of it as a collaborative effort: You provide the ideas, I make them into reality!</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress-as-cms/what-would-you-want-in-the-perfect-wordpress-photo-theme/' addthis:title='What would you want in the perfect WordPress photo theme?' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress-as-cms/what-would-you-want-in-the-perfect-wordpress-photo-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vancouver WordPress Meetup Talk: Simple Yet Powerful WordPress Hacks</title>
		<link>http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks/</link>
		<comments>http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 00:30:41 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Speaking Engagements]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=861</guid>
		<description><![CDATA[Below you&#8217;ll find the code examples for my Vancouver WordPress Meetup group talk Simple Yet Powerful WordPress Hacks held on August 12, 2010. This article will be expanded after the talk but for now it consists only of the code &#8230; <a href="http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Below you&#8217;ll find the code examples for my Vancouver WordPress Meetup group talk Simple Yet Powerful WordPress Hacks held on August 12, 2010. This article will be expanded after the talk but for now it consists only of the code examples themselves.</p>
<h3>Replace blog title with a linked image</h3>
<p>One of my top 10 pet peeves is sites where you can&#8217;t click the logo to get to the home page but have to click the &#8220;Home&#8221; button. This code block can be inserted in the header.php file and it will insert an image (logo) that links back to the home page and also has the alternate text and link title set to the name of the site.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;blog-title&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo get_bloginfo('url') ?&gt;</span></span>/&quot; title=&quot;<span style="color: #009900;">&lt;?php bloginfo<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'name'</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span>&quot; rel=&quot;home&quot;&gt;
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php bloginfo('name') ?&gt;</span></span>&quot; src=&quot;<span style="color: #009900;">&lt;?php echo get_bloginfo<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'template_url'</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span>/imageFolder/imageFile.type&quot; /&gt;
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<h3>Add WP 3.0 menus to non-WP 3.0 themes</h3>
<p>To add WP 3.0 menus to themes that were built before the new version of WordPress or don&#8217;t have them built in you need to activate the menu function in functions.php and then add a call to the menu in your template file.</p>
<p>Add to functions.php:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">register_nav_menus(
	array(
		'menuName' =&gt;__('Menu Name'),
		'2ndMenu' =&gt;__('2nd Menu'),
	)
);</pre></div></div>

<p>Add to template file:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php </span>
<span style="color: #009900;">	wp_nav_menu<span style="color: #66cc66;">&#40;</span>array<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">		 <span style="color: #ff0000;">'theme_location'</span> <span style="color: #66cc66;">=</span>&gt;</span> 'primary'
	)); 
?&gt;</pre></div></div>

<p>Note that the theme_location call points to the name of the menu as set in functions.php. To target the menu name set inside WordPress use this code instead:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php </span>
<span style="color: #009900;">	wp_nav_menu<span style="color: #66cc66;">&#40;</span>array<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">		<span style="color: #ff0000;">'name'</span> <span style="color: #66cc66;">=</span>&gt;</span> 'Menu Name'
	)); 
?&gt;</pre></div></div>

<h3>Highlight current page or category in menu</h3>
<p>I&#8217;ve already written an extensive article on this subject that can be found <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">here</a>. The core of the CSS code is this style:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">.current-menu-item,
.current-page-ancestor,
.current-post-ancestor {
	... style info goes here ...
}</pre></div></div>

<h3>Custom page template in 5 lines of code</h3>
<p>To create a custom page template simply insert the following 5 lines of code at the top of your template file and give it a name other than &#8220;whatever&#8221;. Once saved (as something other than page.php) it will appear as one of your template options inside WordPress.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php </span>
&nbsp;
<span style="color: #009900;"><span style="color: #66cc66;">/</span>* Template <span style="color: #000066;">Name</span>: Whatever *<span style="color: #66cc66;">/</span> </span>
&nbsp;
<span style="color: #009900;">?&gt;</span></pre></div></div>

<h3>Add Featured Image (thumbnail) functionality to your theme</h3>
<p>To activate the Featured Image panel in WordPress admin an enable the function you need to add a small piece of code to the functions.php file. Once this is done and Featured Images have been defined you can call them from within any template file using one of the calls below. </p>
<p>In functions.php:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">add_theme_support( 'post-thumbnails' );</pre></div></div>

<p>In theme file:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php the_post_thumbnail<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span></pre></div></div>

<p>The above call will produce the thumbnail in the size defined inside WordPress admin under Settings -> Media. To call a different size use one of the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">the_post_thumbnail('thumbnail');
the_post_thumbnail('medium');
the_post_thumbnail('large');
the_post_thumbnail(array(nnn,nnn));</pre></div></div>

<p>For the last one replace &#8216;nnn&#8217; with any pixel width and height.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks/' addthis:title='Vancouver WordPress Meetup Talk: Simple Yet Powerful WordPress Hacks' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MIX10 Proposal: I Reject Your Stylesheet and Substitute My Own</title>
		<link>http://www.designisphilosophy.com/microsoft-expression-web/mix10-proposal-i-reject-your-stylesheet-and-substitute-my-own/</link>
		<comments>http://www.designisphilosophy.com/microsoft-expression-web/mix10-proposal-i-reject-your-stylesheet-and-substitute-my-own/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 12:57:14 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Expression Web]]></category>
		<category><![CDATA[Speaking Engagements]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=657</guid>
		<description><![CDATA[Ever since I was invited to attend Microsoft&#8217;s web design and development conference MIX in 2008 I&#8217;ve been itching to submit my own session proposal and get on the podium to share with other developers and designers my experiences working &#8230; <a href="http://www.designisphilosophy.com/microsoft-expression-web/mix10-proposal-i-reject-your-stylesheet-and-substitute-my-own/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-658" title="I reject your stylesheet and substitute my own t-shirt" src="http://www.designisphilosophy.com/wp-content/uploads/2010/01/I-reject-your-stylesheet-and-substitute-my-own-t-shirt.jpg" alt="I reject your stylesheet and substitute my own t-shirt" width="507" height="378" /></p>
<p>Ever since I was invited to attend Microsoft&#8217;s web design and development conference MIX in 2008 I&#8217;ve been itching to submit my own session proposal and get on the podium to share with other developers and designers my experiences working with Expression Web and WordPress. The plan was to submit a proposal for MIX09 but life and work intervened and made it impossible for me to even attend (truth be told I was going to a wedding in Hawaii the same week so I really shouldn&#8217;t complain). But this year March is wide open and I&#8217;ve jumped in head first and submitted a talk with the modest title &#8220;<a title="Vote for my MIX10 OpenCall entry I Reject Your Stylesheet and Substitute My Own" href="http://visitmix.com/opencallvote/Entry?entryId=IREJEC116" target="_blank">I Reject Your Stylesheet And Substitute My Own &#8211; Rapid site design and prototyping with Expression Web 3 and WordPress</a>&#8221; to the OpenCall portion of MIX10. And now I need your help to get my proposal accepted so I can get in and do my thing.</p>
<p>OpenCall is literally a popularity contest: The ten most voted on proposals get a slot at the conference and the rest are left by the wayside. As far as I can tell my proposal is the only one focusing on Expression Web (at least it&#8217;s the only one that shows up on a search) and also the only one talking about WordPress so my hope is that both those interested in the web authoring application and those interested in WordPress specifically or open-source or CMS design in general will find it compelling and want to vote for it. Only time will tell.</p>
<p>To vote for <a title="Vote for my MIX10 OpenCall entry I Reject Your Stylesheet and Substitute My Own" href="http://visitmix.com/opencallvote/Entry?entryId=IREJEC116" target="_blank">I Reject Your Stylesheet and Substitute My Own</a> visit the <a title="Vote for I Reject Your Stylesheet and Substitute My Own" href="http://visitmix.com/opencallvote/Entry?entryId=IREJEC116" target="_blank">OpenCall ballot page found here</a> and click the Add session to ballot button. You can vote for a total of 5 sessions with one ballot. The rest of the sessions can be found <a title="MIX10 OpenCall entries" href="http://visitmix.com/opencallvote/" target="_blank">here</a>. Once you&#8217;re done voting, spread the word and get all your friends to vote for me as well. Voting ends on the 15th of January so there&#8217;s little time but I am certain with your help my name will appear on the roster alongside the many other fantastic speakers at <a title="MIX10" href="http://live.visitmix.com/" target="_blank">MIX10</a>.</p>
<p>Oh, and if you&#8217;re interested the extremely limited edition I Reject Your Stylesheet and Substitute My Own T-shirts are available in green, blue, tan and black sizes S, M and L (Fruit of the Loom, heavy cotton) for $20. <a title="Get the awesome t-shirt" href="http://www.designisphilosophy.com/contact/" target="_blank">Contact me with your name and mailing address</a> and I&#8217;ll wrap one up and send it to you.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/microsoft-expression-web/mix10-proposal-i-reject-your-stylesheet-and-substitute-my-own/' addthis:title='MIX10 Proposal: I Reject Your Stylesheet and Substitute My Own' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/microsoft-expression-web/mix10-proposal-i-reject-your-stylesheet-and-substitute-my-own/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing WaveFront &#8211; a new free WordPress theme</title>
		<link>http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme/</link>
		<comments>http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 22:56:43 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=607</guid>
		<description><![CDATA[Click here to download the free WaveFront theme from the WordPress Theme Directory. The WaveFront theme is a free generic WordPress theme designed to replicate the looks and features of the two custom WordPress sites Stop Living in the Past &#8230; <a href="http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" title="WaveFront" src="http://www.designisphilosophy.com/wp-content/uploads/2009/09/wavefront.jpg" alt="WaveFront" width="506" height="488" /></p>
<blockquote><p><a title="Download WaveFront from the WordPress Theme Directory" href="http://wordpress.org/extend/themes/wavefront" target="_blank">Click here to download the free WaveFront theme from the WordPress Theme Directory.<br />
</a></p></blockquote>
<p>The WaveFront theme is a free generic WordPress theme designed to replicate the looks and features of the two custom WordPress sites <a title="Stop Living in the Past - join the movement to phase out Internet Explorer 6 forever" href="http://www.stoplivinginthepast.com" target="_blank">Stop Living in the Past</a> and <a title="Anny Chih travels the world and blogs about it." href="http://www.annychih.com" target="_blank">AnnyChih.com</a>.</p>
<p>WaveFront provides calm yet stylish layouts customized for basic CMS functionality with several custom page templates including a no-sidebar front page (Front Page template) with three bottom boxes. The theme also has a list of hidden features and extra content that can be turned on and off by editing the template files.</p>
<p>For a full rundown of WaveFront&#8217;s features and customization options please visit the <a title="WaveFront - a calming space" href="http://www.designisphilosophy.com/free-wordpress-themes/wavefront-a-calm-space/" target="_blank">dedicated theme page here</a>.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme/' addthis:title='Introducing WaveFront &#8211; a new free WordPress theme' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Typograph Critical Update for WordPress 2.8</title>
		<link>http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28/</link>
		<comments>http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 15:22:41 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[typograph]]></category>
		<category><![CDATA[wordpress 2.8]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=493</guid>
		<description><![CDATA[It was brought to my attention last night that there is a critical conflict between the popular Typograph theme and the new WordPress 2.8. Knowing that most Typograph users will update their WordPress installation in the coming days finding the &#8230; <a href="http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It was brought to my attention last night that there is a critical conflict between the popular Typograph theme and the new WordPress 2.8. Knowing that most Typograph users will update their WordPress installation in the coming days finding the reason for the conflict and a solution was a number one priority and I am happy to say I&#8217;ve already created a fix that solves the problem. A full upgrade of Typograph will be published later today but for current installations the fix consists of just replacing one file. Here are instructions:</p>
<h3>Upgrade Typograph to work under WordPress 2.8</h3>
<ol>
<li>Download and unzip the archive with the <a title="Download the fixed functions.php file for Typograph." href="http://www.pinkandyellow.com/WP-themes/typographFIX.zip" target="_blank">fixed functions.php file here</a>.</li>
<li>Access your Typograph theme directory in your hosted WordPress installation (should be under www.yoursitename.com/wp-content/themes/Typograph).</li>
<li>Delete the old functions.php file under the Typograph theme directory.</li>
<li>Upload the new functions.php file to the Typograph theme directory.</li>
</ol>
<p>I have tested this critical fix and it works.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28/' addthis:title='Typograph Critical Update for WordPress 2.8' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress-themes/typograph-critical-update-for-wordpress-28/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</title>
		<link>http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation/</link>
		<comments>http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 15:30:48 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[template_tags]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordcamp]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=354</guid>
		<description><![CDATA[Finally, after a full week of catching up, here is the video tutorial version of my presentation at WordCamp Whistler 09 for those who were there and those who couldn&#8217;t come. The video is also available on WordPress.tv if you&#8217;d &#8230; <a href="http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object width="516" height="392" data="http://vimeo.com/moogaloop.swf?clip_id=3061704&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=3061704&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /></object><br />
Finally, after a full week of catching up, here is the video tutorial version of my presentation at WordCamp Whistler 09 for those who were there and those who couldn&#8217;t come. The video is also available on <a title="Watch the video at WordPress.tv" href="http://wordpress.tv/2009/02/04/wordcamp-whislter-2009-using-wordpress-in-alternate-configurations/" target="_blank">WordPress.tv</a> if you&#8217;d rather watch it there. I recorded the video over the weekend and it contains the entire presentation including all my fancy slides as well as the code examples and demos. The only thing you won&#8217;t see is me waving my hands around and messing up the code like I did at the actual event ;o)</p>
<h3>Code Snippets</h3>
<p>The last half of the presentation centers around creating Custom Page Templates and Custom Fields for layout purposes. To help you along in your own WordPress site development, here are those code snippets ready to be cut and pasted into your templates:</p>
<h4>Custom Page Templates in 5 lines of code</h4>
<p>This block of code is inserted at the very top of the Custom Page Template file.  To get started, simply open the page.php file, save it under a different name, paste these 5 lines of code at the top of the document, save and upload to your server. To activate the new Custom Page Template just select it from the Template menu under Attributes in the Page Editor within WordPress.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php <span style="color: #66cc66;">/</span>*</span>
<span style="color: #009900;">Template <span style="color: #000066;">Name</span>: Whatever </span>
<span style="color: #009900;">*<span style="color: #66cc66;">/</span> ?&gt;</span></pre></div></div>

<h4>Custom Fields in one line of code</h4>
<p>This code can be used in any template file including but not limited to page.php, any Custom Page Templates, index.php, archives.php, single.php etc etc. The code returns a string of text that matches the text inserted in the custom field. Remember to replace $key with the actual name of the custom field. <a title="Custom Fields in the WordPress Codex" href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">You can read more about Custom Fields and how to use them in the WordPress Codex</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"> <span style="color: #009900;">&lt;?php echo get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, '$key', true); ?&gt;</pre></div></div>

<h4>Custom Field that parses PHP code</h4>
<p>This code is used to parse (interpret) PHP code inserted into custom fields. It is a bit wonky &#8211; for instance it terminates any other custom field code placed directly after it in a page &#8211; so use it with caution. Otherwise it works exactly as the code above.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php $boxContent <span style="color: #66cc66;">=</span> get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, 'centerBox', true); ?&gt; 
<span style="color: #009900;">&lt;?php eval<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'?'</span>.<span style="color: #ff0000;">'&gt;</span></span>'.$boxContent); ?&gt;</pre></div></div>

<h3>Applications Used in the Presentation</h3>
<p>After the presentation several people came up to me and asked what applications I used, so here is a short list:</p>
<h4>BitNami WordPress Stack</h4>
<p>The demo site I used in the presentation was actually installed and running locally within Windows 7. To achieve this I used an ingenious application named <a title="Download the BitNami WordPress Stack" href="http://bitnami.org/stack/wordpress" target="_blank">BitNami WordPress Stack</a>. Once installed this application will run a fully functional version of WordPress with database entry, plug-ins, custom themes and everything else you want to throw at it right inside Windows (XP, Vista and Windows 7 supported) so you don&#8217;t have to keep uploading your files to a server or hassle through complicated XAMP installs to play around with WordPress while offline. You can even install several different WordPress and other open source CMS stacks on your computer simultaneously to further increase your productivity. I have no idea exactly how it works but BitNami works incredibly well. Just remember to set the IP address to &#8220;localhost&#8221; when you install it.<br />
You can download the BitNami WordPress Stack here. For Mac users there is a similar application called <a title="MAMP" href="http://www.mamp.info/en/index.php" target="_blank">MAMP</a> but I know nothing about it.</p>
<h4>Web Developer Add-On for FireFox</h4>
<p>FireFox is my absolute favourite browser and I use it for browsing as well as in the design process. One of the main advantages of FireFox is the myriad of add-ons you can install that make web site development a lot easier. The one I use the most is the <a title="Download the Web Developer add-on for FireFox" href="https://addons.mozilla.org/en-US/firefox/addon/60" target="_blank">Web Developer Add-On</a>. This small application within an application lets you see and mess with CSS, turn styles and JavaScript on and off and do tons of other stuff that makes it easier to dissect and troubleshoot buggy web pages. Combine it with the <a title="Download the HTML Validator add-on for FireFox" href="https://addons.mozilla.org/en-US/firefox/addon/249" target="_blank">HTML Validator add-on</a> and you have a true powerhouse in a small browser window.</p>
<h4>Microsoft Expression Web 2</h4>
<p>My web development platform of choice is Microsoft Expression Web 2. This new offering from Microsoft is what enables me to build custom WordPress themes and web sites like <a title="Hire Anny Chih for the Best Job in the World" href="http://www.annychih.com" target="_blank">AnnyChih.com</a> from scratch in less than 24 hours. There are many great things you can talk about with Expression Web 2 but for WordPress theme development the two main features is full PHP support, unrivaled CSS integration and Standards Based CSS generation right out of the box. If you want to know more about Expression Web 2 or want to learn how to use it you can read more on this blog or pick up a copy of my book <a title="Teach Yourself Microsoft Expression Web" href="http://tinyurl.com/styexpressionweb2" target="_blank">Sams Teach Yourself Microsoft Expression Web 2 in 24 Hours</a>. It&#8217;s a good read, I promise.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation/' addthis:title='Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Code snippets from my WordCamp presentation</title>
		<link>http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation/</link>
		<comments>http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 17:56:24 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom page templates]]></category>
		<category><![CDATA[whistler]]></category>
		<category><![CDATA[wordcamp]]></category>
		<category><![CDATA[wordcamp whistler]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=332</guid>
		<description><![CDATA[Here are some code snippets from my WordCamp Whistler presentation. This article will be expanded in the coming week but in the meantime here they are for anyone wanting to play around with them: Custom Page Templates in 5 lines &#8230; <a href="http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are some code snippets from my WordCamp Whistler presentation. This article will be expanded in the coming week but in the meantime here they are for anyone wanting to play around with them:</p>
<h3>Custom Page Templates in 5 lines of code</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php</span>
<span style="color: #009900;"><span style="color: #66cc66;">/</span>*</span>
<span style="color: #009900;">Template <span style="color: #000066;">Name</span>: Whatever</span>
<span style="color: #009900;">*<span style="color: #66cc66;">/</span></span>
<span style="color: #009900;">?&gt;</span></pre></div></div>

<h3>Custom Fields in one line of code</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php echo get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, '$key', true); ?&gt;</pre></div></div>

<h3>Custom Field that parses PHP code</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php $boxContent <span style="color: #66cc66;">=</span> get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, 'centerBox', true); ?&gt;
<span style="color: #009900;">&lt;?php eval<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'?'</span>.<span style="color: #ff0000;">'&gt;</span></span>'.$boxContent); ?&gt;</pre></div></div>

<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation/' addthis:title='Code snippets from my WordCamp presentation' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Typograph Theme Update &#8211; Now With Threaded Comments</title>
		<link>http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments/</link>
		<comments>http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 02:44:27 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[threaded comments]]></category>
		<category><![CDATA[typograph]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=316</guid>
		<description><![CDATA[The Typograph theme has proven to be incredibly popular and I have gotten tons of emails and comments about it with suggestions of improvements and updates. As an answer to all the input I have uploaded the 0.8.5 version of &#8230; <a href="http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Download the Typograph theme with threaded comments for WordPress" href="http://wordpress.org/extend/themes/typograph" target="_blank"><img class="aligncenter size-full wp-image-319" title="typograph-new" src="http://blog.pinkandyellow.com/wp-content/uploads/2009/01/typograph-new.jpg" alt="typograph-new" width="500" height="113" /></a>The Typograph theme has proven to be incredibly popular and I have gotten tons of emails and <a title="Great user comments for the Typograph theme" href="http://blog.pinkandyellow.com/css/typography-new-wordpress-theme-20081127/" target="_blank">comments</a> about it with suggestions of improvements and updates. As an answer to all the input I have uploaded the 0.8.5 version of the theme to the <a title="Typograph at the WordPress Theme Directory" href="http://wordpress.org/extend/themes/typograph" target="_blank">WordPress Theme Directory</a> where you can <a title="Download Typograph" href="http://wordpress.org/extend/themes/typograph" target="_blank">download it</a> to spiff up your blog even more.</p>
<h3>Fixing the tabbed box</h3>
<p>One of the major issues with the original Typograph theme was an unexpected one for me: It turned out that the tabbed box was conflicting with a number of popular plug-ins including <a title="Lightbox 2" href="http://wordpress.org/extend/plugins/lightbox-2/" target="_blank">Lightbox 2</a> and others. When these plug-ins were installed one of two things would happen: either the plug-in wouldn&#8217;t work  or the tabbed box wouldn&#8217;t work.</p>
<p>After much discussion both in the <a title="The original Typograph posts" href="http://blog.pinkandyellow.com/css/typography-new-wordpress-theme-20081127/" target="_blank">original post</a> on this blog and also in the <a title="User comments on WordPress.org" href="http://wordpress.org/extend/themes/typograph" target="_blank">support forums</a> on WordPress.org it became clear that the problem was caused by two separate JavaScript conflicts: First off, the NicEdit HTML editor I used for the comments section was clashing with ceartain plug-ins. Seccondly the JQuery library used to create the tabbed box effect was impinging on other JQuery based plug-ins.</p>
<p>To solve this I&#8217;ve done two things: The NicEdit HTML editor for the comments is gone (so no more fancy HTML editing for now, sorry. I&#8217;m looking for a solution) and I have rebuilt the tabbed box from scratch using the MooTools library instead. Extensive testing with numerous plug-ins shows that at least as far as I know the conflicts are no longer there and everything works properly. If you do find any more conflicts, please tell me so I can fix them.</p>
<h4>Threaded Comments</h4>
<p><img class="aligncenter size-full wp-image-318" title="Typograph threaded comments" src="http://blog.pinkandyellow.com/wp-content/uploads/2009/01/threaded-comments.jpg" alt="Typograph threaded comments" width="500" height="291" />One of the really cool new features in WordPress 2.7 is threaded comments. Basically this means that when you comment on a posting you can answer other comments and your answer will appear &#8220;nested&#8221; within the comment you answered rather than on the bottom of the page. This is a very cool feature that you had to use a plug-in for in the past. Upgrading to threaded comments was quite a challenge. There is very little information about it around and it took me a while to figure it out. Luckily I came across two blogs with instructions and it is these two approaches combined that formed the basis for the threaded comments in Typograph. These were <a title="Styling threaded comments in WordPress 2.7" href="http://cdharrison.com/2008/12/threaded-comments/" target="_blank">Chris Harrison&#8217;s blog</a> (for styling) and <a title="Getting threaded comments to work in WordPress 2.7" href="http://ottodestruct.com/blog/2008/09/29/wordpress-27-comments-enhancements/" target="_blank">Otto&#8217;s blog</a> for backend code. Thanks go out to the both of them for excellent tutorials and to Otto for some extra help via e-mail.</p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments/' addthis:title='Typograph Theme Update &#8211; Now With Threaded Comments' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress-themes/typograph-theme-update-now-with-threaded-comments/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Using Conditional Custom Fields for Advanced Layouts</title>
		<link>http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts/</link>
		<comments>http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 08:37:17 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=276</guid>
		<description><![CDATA[An often overlooked function in the WordPress arsenal is Custom Fields. Overlooked because to most it makes no sense: What do you use a custom field for? And how do you use it? The answers to these questions differ depending &#8230; <a href="http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>An often overlooked function in the WordPress arsenal is Custom Fields. Overlooked because to most it makes no sense: What do you use a custom field for? And how do you use it? The answers to these questions differ depending on how the WordPress theme has been set up: Custom fields can be used for everything from passing information to plug-ins like Next Gen Gallery to feeding custom areas in the template with information. But it goes way beyond that. Custom Fields can also be used to create advanced layouts and design variances that can be triggered on a page by page or post by post basis. And this tehcnique can be edhanced further by adding conditions to the scripts so that the changes only appear when the field is actually activated.</p>
<h3>Understanding custom fields</h3>
<p>You can add custom fields to any WordPress post or page through the custom fields interface found right underneath the main text area. The custom field contains two elements; a name and a value. These are pretty self explanatory: When the template asks the server for the name, the value is returned. But this also means that unless the template actually asks for the field by name, nothing is returned. An example to show how this works in real life:</p>
<p><img class="aligncenter size-full wp-image-278" title="Artist menu" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/12/artistmen.jpg" alt="Artist menu" width="498" height="143" />A web site for an art gallery requires each artist page to have a series of sub-pages containing an artists statement, bio, CV and image gallery. Although adding an unordered list directly to the text body of the page would work, it would require the addition of style elements and tags &#8211; something WordPress doesn&#8217;t like very much. Not to mention it&#8217;s also cumbersome and messy. A better solution is to place all the style tags in the template and then just feed the menu in the form of a standard unordered list from a custom field, in this case with the name &#8220;artistMenu&#8221;. Then all that&#8217;s left is to get the template to call for the info in the custom field like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;artistMenu&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;?php echo get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;artistMenu&quot;, true); ?&gt;		
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>When the template is opened, the content of the custom field named &#8220;artistMenu&#8221; is placed as a string inside the artistMenu div. (To understand exactly how the php code works you can read about the <a title="More info on the get_post_meta tag" href="http://codex.wordpress.org/Function_Reference/get_post_meta" target="_blank">get_post_meta</a> template tag in the WordPress Codex.)</p>
<h3>Making the custom fields conditional</h3>
<p>The problem with the example above is that even if there is no custom field defined, the div is still placed in the page taking up space. Not a big problem when it&#8217;s just a horizontal menu but if you use a custom field to populate something larger, like an image gallery or a text box, it will look weird if the box is left empty. One way of avoiding this is to make two separate templates, one with the custom field code and one without, but that can quickly become complicated. And the whole idea here is to make things simpler, not more complicated. A better way is to make the code and the call for the custom field conditional on whether the custom field has been defined in the first place. This can be done with a simple <em>if</em> statement:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php  if<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;artistMenu&quot;, true))) { ?&gt;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;artistMenu&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;?php echo get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;artistMenu&quot;, true); ?&gt;		
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span></pre></div></div>

<h3>Using conditional custom fields as design elements</h3>
<p>Now for the really cool stuff: Because we can make custom fields conditional, and because we can populate them with pretty much anything, we can use them not only to add images or text but also to add all new design and layout elements. In the site I built for <a title="Sablok &amp; Sablok - Notaries Public" href="http://sablok.com" target="_blank">Sablok &amp; Salbok Notaries Public</a> I used this technique to create a header element that only appears if the custom field is populated by an image or text. The actual appearance of the element is controlled by standard CSS. You can see this layout element as the blue horizontal area in the image and on the front page of the site.</p>
<p><img class="aligncenter size-full wp-image-279" title="Sablok &amp; Sablok custom field" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/12/sablok.jpg" alt="Sablok &amp; Sablok custom field" width="499" height="203" />In this particular example the custom field can be populated by an image. Rather than forcing the user to input all the image code in the custom field manually I added some extra code in the template that gathers the width and height of the image and creates the proper element code. As a result all the user has to do is provide the URL for the image. There is also an <em>or</em> condition in the <em>if</em> statement so that the custom field code in the template is triggered either when an image field or a text field is defined:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php  if<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;image&quot;, true)) || (get_post_meta($post-&gt;ID, &quot;text&quot;, true))) { ?&gt;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;subheader&quot;</span>&gt;</span>
&nbsp;
		<span style="color: #009900;">&lt;?php if<span style="color: #66cc66;">&#40;</span>get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;image&quot;, true)) {
		$size = getimagesize(get_post_meta($post-&gt;ID, &quot;image&quot;, true)); ?&gt;
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo get_post_meta($post-&gt;</span></span>ID, &quot;image&quot;, true); ?&gt;&quot; alt=&quot;&quot; width=&quot;<span style="color: #009900;">&lt;?php echo $size<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>; ?&gt;</span>&quot; height=&quot;<span style="color: #009900;">&lt;?php echo $size<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>; ?&gt;</span>&quot; /&gt;
		<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span>
&nbsp;
		<span style="color: #009900;">&lt;?php if<span style="color: #66cc66;">&#40;</span>get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;text&quot;, true)) {?&gt;
		<span style="color: #009900;">&lt;?php echo get_post_meta<span style="color: #66cc66;">&#40;</span>$post-&gt;</span>ID, &quot;text&quot;, true); ?&gt;
		<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- END SUBHEADER --&gt;</span>
<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span></pre></div></div>

<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts/' addthis:title='Using Conditional Custom Fields for Advanced Layouts' ><a class="addthis_button_facebook like"></a><a class="addthis_button_twitter"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>

