<?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 - The Pink &#38; Yellow Media Blog &#187; wordpress</title>
	<atom:link href="http://www.designisphilosophy.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designisphilosophy.com</link>
	<description>Tutorials and thoughts on Microsoft Expression, CSS and WordPress</description>
	<lastBuildDate>Wed, 08 Sep 2010 17:48:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<atom:link rel='hub' href='http://www.designisphilosophy.com/?pushpress=hub'/>
		<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-20100812/</link>
		<comments>http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks-20100812/#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 Themes]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[wordpress]]></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 examples themselves. Replace blog title with a linked image One of my top 10 pet [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
<li><a href='http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/' rel='bookmark' title='Permanent Link: Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?'>Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?</a></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
<li><a href='http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/' rel='bookmark' title='Permanent Link: Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?'>Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks-20100812/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlight Current Page or Category in WordPress 3.0 Menus</title>
		<link>http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/</link>
		<comments>http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 17:00:22 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[custom menu]]></category>
		<category><![CDATA[menu highlighting]]></category>
		<category><![CDATA[wp 3.0]]></category>
		<category><![CDATA[wp themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=842</guid>
		<description><![CDATA[Almost two years ago I published an article on how to create custom WordPress menus that highlighted the current page. It&#8217;s still one of the most popular posts on this site, and for good reason: Current page highlighting is vital to ensure a good user experience for your visitors. Without current page highlighting it&#8217;s hard [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
<li><a href='http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks-20100812/' rel='bookmark' title='Permanent Link: Vancouver WordPress Meetup Talk: Simple Yet Powerful WordPress Hacks'>Vancouver WordPress Meetup Talk: Simple Yet Powerful WordPress Hacks</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Almost two years ago I published an article on <a title="http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/" href="http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/" target="_blank">how to create custom WordPress menus that highlighted the current page</a>. It&#8217;s still one of the most popular posts on this site, and for good reason: Current page highlighting is vital to ensure a good user experience for your visitors. Without current page highlighting it&#8217;s hard for the visitor to know if she is on the correct page or not. Now it&#8217;s time to upgrade that tutorial to incorporate the new custom menu functionality in WordPress 3.0 and also add some new functionality.</p>
<h3>WordPress 3.0 menus simplify everything&#8230; once you understand them</h3>
<p>One of the major improvements shipped in WordPress 3.0 was the custom menu functionality. In the past menus were restricted to either simple page or category lists, hard-coded menus stored in the theme files or cumbersome 3rd party plug-ins. No such trouble any more. Custom menus are now available from right within the WordPress admin panel, found under the Appearance tab. And even if you have an older theme that doesn&#8217;t support the new menus you can still use them in your sidebar as widgets.</p>
<p>I&#8217;m not going to cover how to use the menus from within the admin panel. For that I recommend you read <a title="How to use the new WordPress 3.0 menus - from the WordPress Codex" href="http://codex.wordpress.org/Appearance_Menus_SubPanel" target="_blank">this WordPress Codex article</a> that explains it quite well. Instead I&#8217;m going to talk about what you can do with these menus styling wise.</p>
<h3>Dissecting the stock menu output</h3>
<p>To see what&#8217;s possible with these new menus let&#8217;s first take a look at the code output from the stock menus. In this example I&#8217;ve created one menu with the name &#8220;My First Menu&#8221; and added it to the site using a sidebar widget. The menu has three buttons; Home pointing to the home page, About pointing to the About page and Contact pointing to the Contact page. (To make the code easier to read I&#8217;ve removed the sidebar &lt;ul&gt; and &lt;li&gt; tags so you only see the actual menu output.)</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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-My-First-Menu-container&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-My-First-Menu&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item-37&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item menu-item-type-custom current-menu-item current_page_item menu-item-home menu-item-37&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Home&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://mysite.com/&quot;</span>&gt;</span>Home<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;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item-38&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item menu-item-type-post_type menu-item-38&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;About&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://mysite.com/about/&quot;</span>&gt;</span>About<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;">li</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item-39&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item menu-item-type-post_type menu-item-39&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Contact&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://mysite.com/contact/&quot;</span>&gt;</span>Contact<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;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</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>

<p>The key information for this tutorial can be found on line 4:</p>
<p>The first list item has an ID attached to it and then a huge array of classes. They are: &#8220;menu-item&#8221;, &#8220;menu-item-type-custom&#8221;, &#8220;current-menu-item&#8221;, &#8220;current_page_item&#8221;, &#8220;menu-item-home&#8221; and &#8220;menu-item-37&#8243;. Of these the three that matter to us are &#8220;current-menu-item&#8221;, &#8220;current_page_item&#8221; and &#8220;menu-item-home&#8221;. Using these custom classes you can create custom styles that highlight or otherwise affect only certain elements:</p>
<p><strong>.current-menu-item { }</strong> targets only the menu item the visitor pressed to get to the menu. This goes for categories as well as pages.</p>
<p><strong>.current-page-item { }</strong> targets only the current menu item if that menu item is pointing to a page and the visitor is on that page.</p>
<p><strong>.menu-item-home { }</strong> targets only the menu item that points to the root or home page of the site.</p>
<p>So, to answer the question from the original artice: How do I highlight the current page in my menu? The answer is create a custom class style with the name .current-menu-item.  As a bonus this style will not only target your pages but also your category index pages and your home page. In the past you had to create separate styles for these.</p>
<h3>Going deeper with child pages</h3>
<p>But this is just the beginning. With the new WordPress menus you can create custom styles that target more than just pages and category indexes. It turns out the code output for these custom menus is highly dynamic and it interacts with all the content on your page whether you actually use the menus or not. The code output above was generated after clicking on the home page and thus resulted in the three classes listed above (notice those three classes are not present in the two other list items). But what if you went to a page that was a child of one of the menu pages? In the past that would mean the parent page would not be highlighted in the menu. But now it can.</p>
<p>The code below was grabbed from the same site as before after I opened a page for which the About page is the parent:</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;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item-38&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item menu-item-type-post_type current-page-ancestor menu-item-38&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;About&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://mysite.com/about/&quot;</span>&gt;</span>About<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;">li</span>&gt;</span></pre></div></div>

<p>Look closely at the class array and you&#8217;ll find this new class: &#8220;current-page-ancestor&#8221;. This class is activated every time the visitor opens a page that has a parent page that is featured on the menu. That means you can use this class to highlight the parent in the menu. The easiest way to do this is by simply adding the new class to the style of the original .current-menu-item class:</p>
<p><strong>.current-menu-item, current-page-ancestor { }</strong> targets either the menu item for the current page or the menu item for the parent page if a child page is visited.</p>
<h3>Category highlighting for single posts</h3>
<p>It gets even more interesting when we look at category menu items. Like in the past you can create menus that point to category archives. And you can use the .current-menu-item class to highlight the current category in the menu if you&#8217;re on the category index page. But what if you want to highlight the category (or categories) of a particular post when that post is open? Again there are custom classes for 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;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item-40&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;menu-item menu-item-type-taxonomy current-post-ancestor current-menu-parent current-post-parent menu-item-40&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Commercials&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://mysite.com/category/commercial/&quot;</span>&gt;</span>Commercial<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;">li</span>&gt;</span></pre></div></div>

<p>Here the three classes &#8220;current-post-ancestor&#8221;, &#8220;current-menu-parent&#8221; and &#8220;current-post-parent&#8221; are what matters. Either of the three will allow you to highlight the category (or categories) the current post belongs to, but they each work in different ways:</p>
<p><strong>.current-post-ancestor { }</strong> targets the menu item as long as the category the menu item points at is an ancestor of the post (so regardless of whether the post is in the category or in a sub-category under the category)</p>
<p><strong>.current-menu-parent { }</strong> targets the menu item if it is the parent of the menu to which the post belongs (yes, it&#8217;s confusing).</p>
<p><strong>.current-post-parent { }</strong> targets the menu item only if the category is the direct parent of the post (menu item will not be highlighted if the post only belongs to a category that is a child of the category the menu item points to).</p>
<h3>Bottom line: The style that highlights pages, categories and parents</h3>
<p>Because of how this new menu system is set up, and because it works so well you only really need to create one custom style if you want to highlight the current page, current category, page parent and category parent in your menu:</p>

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

<p>To get more advanced you can also create separate highlighting styles depending on what type of menu item it is or what relationship it has to the page, post or index. And if you have multiple menus you can create entirely separate style sets for each of these, complete with current page, post and category highlighting. The posibilities are if not endless then at least quite extensive.</p>
<p>Upon first inspection the code output of the new WordPress 3.0 menu system may look quite messy but now that you see what it&#8217;s all for I think you&#8217;ll agree with me that this heralds in a whole new age of menu customization for theme developers.</p>
<p>If you want to see this stuff in practice head on over to the website for the <a title="12x12 Vancouver Photo Marathon" href="http://vancouverphotomarathon.com/wp-content/uploads/2010/07/2010-12x12-Vancouver-Photo-Marathon-Poster.pdf" target="_blank">12&#215;12 Vancovuer Photo Marathon</a> where I&#8217;ve implemented tons of custom menu highlighting.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/' rel='bookmark' title='Permanent Link: Highlight current page in WordPress menus'>Highlight current page in WordPress menus</a></li>
<li><a href='http://www.designisphilosophy.com/events/vancouver-wordpress-meetup-talk-simple-yet-powerful-wordpress-hacks-20100812/' rel='bookmark' title='Permanent Link: Vancouver WordPress Meetup Talk: Simple Yet Powerful WordPress Hacks'>Vancouver WordPress Meetup Talk: Simple Yet Powerful WordPress Hacks</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cool Author Box: Free WordPress Plugin</title>
		<link>http://www.designisphilosophy.com/wordpress/cool-author-box-free-wordpress-plugin-20100514/</link>
		<comments>http://www.designisphilosophy.com/wordpress/cool-author-box-free-wordpress-plugin-20100514/#comments</comments>
		<pubDate>Sat, 15 May 2010 00:26:43 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[author bio]]></category>
		<category><![CDATA[author box]]></category>
		<category><![CDATA[expression web]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=753</guid>
		<description><![CDATA[After designing and building the Fancy Profile Box for the Pink &#38; Yellow Media site I published an article on how to recreate it as a cool author box in your WordPress blog. This tutorial spurred a lot of interest and I got several emails and tweets asking me to convert it to a plugin. [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/' rel='bookmark' title='Permanent Link: Build a fancy WordPress author box'>Build a fancy WordPress author box</a></li>
<li><a href='http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme-20090922/' rel='bookmark' title='Permanent Link: Introducing WaveFront &#8211; a new free WordPress theme'>Introducing WaveFront &#8211; a new free WordPress theme</a></li>
<li><a href='http://www.designisphilosophy.com/css/typography-new-wordpress-theme-20081127/' rel='bookmark' title='Permanent Link: Typograph &#8211; new WordPress Theme'>Typograph &#8211; new WordPress Theme</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-755" title="Cool Author Box WordPress plugin" src="http://www.designisphilosophy.com/wp-content/uploads/2010/05/coolauthorbox.jpg" alt="" width="516" height="186" /></p>
<p>After designing and building the Fancy Profile Box for the <a title="Vancouver web design and WordPress development - Pink &amp; Yellow Media" href="http://www.pinkandyellow.com" target="_blank">Pink &amp; Yellow Media</a> site I published an article on how to recreate it as a <a title="Create a cool author box for your WordPress blog" href="http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/" target="_blank">cool author box in your WordPress blog</a>. This tutorial spurred a lot of interest and I got several emails and tweets asking me to convert it to a plugin. So I did.</p>
<p>As of right now the virst version (0.0.1) of the Cool Author Box plugin is <a title="Download Cool Author Box WordPress Plugin" href="http://wordpress.org/extend/plugins/cool-author-box/" target="_blank">available for download from the WordPress plugin directory</a>. It is pre-beta and comes without any warranty or guarantees, but I&#8217;ve tested it on 4 very different blogs and it works fine on all of those.</p>
<p>The Cool Author Box WordPress plugin has been submitted to the WordPress Plugin Directory and I&#8217;ll announce it once it is accepted.</p>
<h4><a title="Download Cool Author Box WordPress Plugin" href="http://wordpress.org/extend/plugins/cool-author-box/" target="_blank">Click here to download  the Cool Author Box WordPress plugin</a></h4>
<h3>Here&#8217;s the full rundown</h3>
<p>The Cool Author Box plugin adds a stylish author box after the content in posts and/or pages. The box displays author name, author bio, author gravatar and a link to other articles by the author.</p>
<p>The Cool Author Box plugin adds information about the author to the bottom of the content of posts and/or pages. The information is gathered from the profile info set inside WordPress.</p>
<p>Items displayed are:</p>
<ul>
<li>Display name of the author of the post or page</li>
<li>Gravatar of the author (set at www.gravatar.com)</li>
<li>Link to other posts by the same author</li>
<li>Link to author&#8217;s website</li>
</ul>
<p>To make the author box appear you need to activa the plugin and go to the Cool Author Box settings under Settings and select if the box should appear under posts, pages or both.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/' rel='bookmark' title='Permanent Link: Build a fancy WordPress author box'>Build a fancy WordPress author box</a></li>
<li><a href='http://www.designisphilosophy.com/wordpress-themes/introducing-wavefront-a-new-free-wordpress-theme-20090922/' rel='bookmark' title='Permanent Link: Introducing WaveFront &#8211; a new free WordPress theme'>Introducing WaveFront &#8211; a new free WordPress theme</a></li>
<li><a href='http://www.designisphilosophy.com/css/typography-new-wordpress-theme-20081127/' rel='bookmark' title='Permanent Link: Typograph &#8211; new WordPress Theme'>Typograph &#8211; new WordPress Theme</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/cool-author-box-free-wordpress-plugin-20100514/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Build a fancy WordPress author box</title>
		<link>http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/</link>
		<comments>http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/#comments</comments>
		<pubDate>Fri, 07 May 2010 23:12:22 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[author box]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wp themes]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=736</guid>
		<description><![CDATA[If you have a WordPress site or blog with multiple authors it might be useful to create a custom author box for each of them so the readers can get more information about the author and see their other posts etc. This tutorial is an extension of my Fancy Profile or Author Box tutorial from [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/wordpress/cool-author-box-free-wordpress-plugin-20100514/' rel='bookmark' title='Permanent Link: Cool Author Box: Free WordPress Plugin'>Cool Author Box: Free WordPress Plugin</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/' rel='bookmark' title='Permanent Link: Build a fancy author or profile box with Expression Web'>Build a fancy author or profile box with Expression Web</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/' rel='bookmark' title='Permanent Link: Highlight Current Page or Category in WordPress 3.0 Menus'>Highlight Current Page or Category in WordPress 3.0 Menus</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you have a WordPress site or blog with multiple authors it might be useful to create a custom author box for each of them so the readers can get more information about the author and see their other posts etc. This tutorial is an extension of my <a title="Build a fancy author or profile box with Expression Web" href="http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/" target="_blank">Fancy Profile or Author Box tutorial</a> from a couple of weeks back that customizes the author box to work with WordPress.</p>
<h3>The final result</h3>
<p>The goal of this tutorial is to create an author box like the one you see at the top of this article. The box above is the actual output of the working code and as you can see it works quite well. The box is conditional and activated by a custom field so it will only appear when you want it to. The bio is the standard profile bio entered in the WordPress user profile area. The name is the chosen display name of the user and links to the author index for the author. The website link opens the user defined website in a new window. The Twitter link goes to the user Twitter profile. And finally the image is the user Gravatar. The Twitter link is a bit wonky &#8211; I&#8217;ll get back to that later.</p>
<p>If you don&#8217;t want to go through the entire tutorial and learn how this all fits together just jump to the bottom of the article and get the source code.</p>
<h3>Building the code</h3>
<p>We already have the baseline for the code, both HTML and CSS, from the <a title="Build a fancy author or profile box with  Expression Web" href="../microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/" target="_blank">Fancy  Profile or Author Box tutorial</a> but this is going to be a dynamic box so we need to replace the static content with WordPress functions.</p>
<p>Let&#8217;s start with the baseline code:</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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profile&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileText&quot;</span>&gt;</span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Author bio goes here --&gt;</span>
	<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 .profileText --&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileStats&quot;</span>&gt;</span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Author photo goes here --&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileName&quot;</span>&gt;</span>
			<span style="color: #808080; font-style: italic;">&lt;!-- Author name linking to author post index goes here --&gt;</span>
		<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 .profileName --&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileJob&quot;</span>&gt;</span>
			<span style="color: #808080; font-style: italic;">&lt;!-- Author info (website and Twitter handle) goes here --&gt;</span>
		<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 .profileJob --&gt;</span>
	<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 .profileStats --&gt;</span>
<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 .profile --&gt;</span></pre></div></div>

<h3>Retrieving the dynamic author elements</h3>
<p>To generate the dynamic content we are going to use a set of standard WordPress functions. These have changed over the last year or so and as a result the ones featured in many older tutorials are now deprecated.</p>
<p>To get the author bio we use <a href="http://codex.wordpress.org/Template_Tags/the_author_meta" title="Full breakdown of the the_author_meta() function in the WordPress Codex" target="_blank">the_author_meta()</a>:</p>

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

<p>To get the author Gravatar we use a custom code block that gets the user email address and retrieves the correct Gravatar based on that address:</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>function_exists<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'get_avatar'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> echo get_avatar<span style="color: #66cc66;">&#40;</span> get_the_author_email<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">'80'</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>?&gt;</span></pre></div></div>

<p>To display the author name as a link to the author index page we use the <a href="http://codex.wordpress.org/Template_Tags/the_author_posts_link" title="Full breakdown of the the_author_post_link() function in the WordPress Codex" target="_blank">the_author_post_link()</a>. It&#8217;s an all-in-one solution that outputs the name with the correct link attached:</p>

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

<p>For the links to the author website and Twitter account we use <a href="http://codex.wordpress.org/Template_Tags/the_author_meta" title="Full breakdown of the the_author_meta() function in the WordPress Codex" target="_blank">the_author_meta()</a> again interspersed with some plain text. Note that you have to combine several functions to get the name displayed as well as the link created:</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;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php the_author_meta('user_url'); ?&gt;</span></span>&quot; title=&quot;<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>'s website&quot;&gt;<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>'s website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
Follow <span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span> on <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;http://www.twitter.com/&lt;?php the_author_meta('aim'); ?&gt;</span></span>&quot; title=&quot;Twitter name: <span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'aim'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&quot;&gt;Twitter<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<h3>A caveat: The Twitter handle is a bit of a cheat!</h3>
<p>If you look at the last line of the last code example you&#8217;ll see that for the Twitter name I&#8217;m actually calling the AIM value (AIM being America Online Messenger). This is because the standard WordPress profile page only asks for your e-mail, website, AIM, Yahoo IM and Jabber / Google Talk information. I wasn&#8217;t aware anyone was using AIM any more and I have a feeling this is a leftover from way back so I chose to use this field to output the Twitter handle because it has the least chance of anyone actually using it. There is a way to add Twitter and other handles properly but this requires the use of plugins &#8211; something I&#8217;m not a big fan of. If you&#8217;re interested there is some information on it in the <a href="http://codex.wordpress.org/Template_Tags/the_author_meta#Advanced_Uses" title="Full breakdown of the the_author_meta() function in the WordPress Codex" target="_blank">WordPress Codex</a>.</p>
<h3>Putting it all together</h3>
<p>Now that we have the source code and all the correct dynamic tags it&#8217;s time to put it all together. The end result (barring any changes you decided to make on your own) should look 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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profile&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileText&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'description'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>
	<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 .profileText --&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileStats&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>function_exists<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'get_avatar'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> echo get_avatar<span style="color: #66cc66;">&#40;</span> get_the_author_email<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">'80'</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>?&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileName&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;?php the_author_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span> 
		<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 .profileName --&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileJob&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 the_author_meta('user_url'); ?&gt;</span></span>&quot; title=&quot;<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>'s website&quot;&gt;<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>'s website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
									Follow <span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span> on <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;http://www.twitter.com/&lt;?php the_author_meta('aim'); ?&gt;</span></span>&quot; title=&quot;Twitter name: <span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'aim'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&quot;&gt;Twitter<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> <span style="color: #808080; font-style: italic;">&lt;!-- END .profileJob --&gt;</span>
	<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 .profileStats --&gt;</span>
<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 .profile --&gt;</span></pre></div></div>

<h3>Making it conditional</h3>
<p>If you cut and paste the code above into your page or post template it will appear in every page or post. Which I&#8217;m pretty sure is now what you want. To make it elective you need to make a conditional statement in the code. I do this by using Custom Fields, in this case a field with the name &#8220;author&#8221; and the value &#8220;true&#8221; or &#8220;false&#8221;:</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, 'author', true))) { ?&gt;
	<span style="color: #808080; font-style: italic;">&lt;!-- Code goes here --&gt;</span>
<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span></pre></div></div>

<p>This small function asks &#8220;if this current post has a custom field with the name &#8220;author&#8221; that is set to &#8220;true&#8221;, do what I say&#8221;. That way your box will only appear if the custom field has been defined.</p>
<h3>The final HTML/PHP markup</h3>
<p>With the conditional statement in place the complete markup to be pasted into your theme file looks like this:</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, 'author', true))) { ?&gt;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profile&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileText&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'description'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>
		<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 .profileText --&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileStats&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>function_exists<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'get_avatar'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> echo get_avatar<span style="color: #66cc66;">&#40;</span> get_the_author_email<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">'80'</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>?&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileName&quot;</span>&gt;</span>
				<span style="color: #009900;">&lt;?php the_author_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span> 
			<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 .profileName --&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;profileJob&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 the_author_meta('user_url'); ?&gt;</span></span>&quot; title=&quot;<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>'s website&quot;&gt;<span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>'s website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
									Follow <span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'first_name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span> on <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;http://www.twitter.com/&lt;?php the_author_meta('aim'); ?&gt;</span></span>&quot; title=&quot;Twitter name: <span style="color: #009900;">&lt;?php the_author_meta<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'aim'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&quot;&gt;Twitter<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> <span style="color: #808080; font-style: italic;">&lt;!-- END .profileJob --&gt;</span>
		<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 .profileStats --&gt;</span>
	<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 .profile --&gt;</span>
<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span></pre></div></div>

<h3>Where to put the code</h3>
<p>Like I said, this code has to be inserted into your theme files for the box to work. The easiest way to do this is actually to place it in a separate PHP file called something like &#8220;profile.php&#8221; and then call in from the theme files in question. That way you don&#8217;t have to edit the core theme files if you want to make a change to the box and adding it to new files means adding just one line of code.</p>
<p>If you placed this code (and only this code) in a file inside your theme called &#8220;profile.php&#8221; calling it from one of your core theme files is as easy as adding this one line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php include <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&lt;?php echo get_bloginfo('</span>template_url<span style="color: #ff0000;">') ?&gt;</span></span>/profile.php'); ?&gt;</pre></div></div>

<p>Where you insert it depends on where you want the box to appear in relation to your post content. If you want it to appear directly above you insert it before the <em><strong>the_content()</strong></em> function call. If you want it to appear after you insert it after and so on. Since you&#8217;re only inserting one line of code it&#8217;s easy to experiment and move it around for the best placement. And since the CSS is flexible width it will work properly pretty  much regardless of the width of your post area. </p>
<p>The only thing to keep in mind is that the author box must be called from within the loop, otherwise it will not work.</p>
<h3>The final CSS markup</h3>
<p>The CSS markup for the author box is pretty much identical to the CSS in <a title="Build a fancy author or profile box with Expression Web" href="http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/" target="_blank">the original tutorial</a>. I&#8217;ve just added some specifications to avoid conflicts. All you need to do is paste this into your styles.css file, get the <a href="http://designisphilosophy.com/tutorials/FancyProfile/testimonialBlue.gif" title="Get the background image file" target="_blank">blue background image file</a> and place it in your theme image folder and make sure the call to the file has the correct image folder name.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">/* AUTHOR BOX STYLES */
&nbsp;
.profile {
	border: 1px solid #CCCCCC;
	position: relative;
}
&nbsp;
.profileText {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 0.8em;
	padding: 10px;
	line-height: 1.4em;
	text-align: justify;
}
&nbsp;
.profileStats {
	font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;
	font-style: italic;
	text-align: right;
}
&nbsp;
.profileStats img {
	position: absolute;
	right: 0px;
	bottom: 0px;
}
&nbsp;
.profileName {
	padding-bottom: 5px;
	padding-right: 92px;
	font-size: 1.2em;
	font-weight: bold;
	color: #2e4672;
}
&nbsp;
.profileName a {
	color: #2e4672;
}
&nbsp;
.profileName a:hover {
	color:#24375B;
	text-decoration: none;
}
&nbsp;
.profileJob {
	font-size: 0.8em;
	padding-right: 92px;
	padding-top: 5px;
	background-image: url('{image folder}/testimonialBlue.gif'); /* Remember to set the correct image folder here */
	background-repeat: repeat-x;
	height: 45px;
	color: #FFFFFF;
	line-height: 18px;
}
&nbsp;
.profileJob a {
	color: #FFFFFF;
	font-weight: bold;
	text-decoration: none;
}
&nbsp;
/* END AUTHOR BOX STYLES */</pre></div></div>

<p>That&#8217;s all there is to it. Have fun adding this box to your website or blog and customizing it to fit with your theme. And if you like, drop a comment below to show it off to the world.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/wordpress/cool-author-box-free-wordpress-plugin-20100514/' rel='bookmark' title='Permanent Link: Cool Author Box: Free WordPress Plugin'>Cool Author Box: Free WordPress Plugin</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/' rel='bookmark' title='Permanent Link: Build a fancy author or profile box with Expression Web'>Build a fancy author or profile box with Expression Web</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/' rel='bookmark' title='Permanent Link: Highlight Current Page or Category in WordPress 3.0 Menus'>Highlight Current Page or Category in WordPress 3.0 Menus</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>By Land, Sea or Air &#8211; A travel blog based on the MyKipple project</title>
		<link>http://www.designisphilosophy.com/news/by-land-sea-or-air-a-travel-blog-based-on-the-mykipple-project-20091022/</link>
		<comments>http://www.designisphilosophy.com/news/by-land-sea-or-air-a-travel-blog-based-on-the-mykipple-project-20091022/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:26:01 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[My Book]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=626</guid>
		<description><![CDATA[We&#8217;ve been talking about taking a road trip through the USA for a long time, so when my TV job ended in October we decided now was the time. And in true blogger fashion, a road trip required a dedicated blog just for that and nothing else. This also presented an opportunity for me to [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/news/my-book-is-featured-in-the-canadian-user-experience-blog-20081201/' rel='bookmark' title='Permanent Link: My book is featured in the Canadian User Experience Blog'>My book is featured in the Canadian User Experience Blog</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/wordpress-as-cms-the-project-20080312/' rel='bookmark' title='Permanent Link: WordPress as CMS &#8211; The Project'>WordPress as CMS &#8211; The Project</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-627" title="By Land, Sea or Air" src="http://www.designisphilosophy.com/wp-content/uploads/2009/10/bylandseaorair.jpg" alt="By Land, Sea or Air" width="506" height="571" />We&#8217;ve been talking about taking a road trip through the USA for a long time, so when my TV job ended in October we decided now was the time. And in true blogger fashion, a road trip required a dedicated blog just for that and nothing else. This also presented an opportunity for me to show people how far you can push the MyKipple.com design I created for my new book Sams Teach Yourself Micrsoft Expression Web 3 in 24 Hours.</p>
<p>The result was <a title="Follow our road trip around the USA" href="http://bylandseaorair.com" target="_blank">ByLandSeaOrAir.com</a> &#8211; a WordPress based site with a theme that utilizes all the tips and techniques showcased in the book. Fact is if you go in and lift out all the code and graphics from the new site you&#8217;ll see that it matches the final project in the book almost line by line.</p>
<p>So the site serves two purposes: To tell the world of our travels and to show that there really is no limit to what you can do once you understand the principles behind HTML and CSS. Enjoy.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/news/my-book-is-featured-in-the-canadian-user-experience-blog-20081201/' rel='bookmark' title='Permanent Link: My book is featured in the Canadian User Experience Blog'>My book is featured in the Canadian User Experience Blog</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/wordpress-as-cms-the-project-20080312/' rel='bookmark' title='Permanent Link: WordPress as CMS &#8211; The Project'>WordPress as CMS &#8211; The Project</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/news/by-land-sea-or-air-a-travel-blog-based-on-the-mykipple-project-20091022/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 upgrade woes</title>
		<link>http://www.designisphilosophy.com/wordpress/wordpress-28-upgrade-woes-20090611/</link>
		<comments>http://www.designisphilosophy.com/wordpress/wordpress-28-upgrade-woes-20090611/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 23:17:40 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[2.8]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=501</guid>
		<description><![CDATA[As you may have noticed the new version of WordPress &#8211; 2.8 &#8211; was released yesterday. And that started a cascade of people complaining their blogs were all of a sudden gone &#8211; replaced by a plain white page. I&#8217;ve been plugging at this all night and into today and I&#8217;ve found some nasty little [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/wordpress/6-must-have-wordpress-plug-ins-20081114/' rel='bookmark' title='Permanent Link: 6 Must Have WordPress Plug-ins'>6 Must Have WordPress Plug-ins</a></li>
<li><a href='http://www.designisphilosophy.com/wordpress/wordpress-27-is-just-around-the-corner-20081202/' rel='bookmark' title='Permanent Link: WordPress 2.7 to be released Dec. 4th'>WordPress 2.7 to be released Dec. 4th</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/wordpress-as-cms-the-project-20080312/' rel='bookmark' title='Permanent Link: WordPress as CMS &#8211; The Project'>WordPress as CMS &#8211; The Project</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As you may have noticed the new version of WordPress &#8211; 2.8 &#8211; was released yesterday. And that started a cascade of people complaining their blogs were all of a sudden gone &#8211; replaced by a plain white page. I&#8217;ve been plugging at this all night and into today and I&#8217;ve found some nasty little bugs/inconsistencies that seem to be the main culprits in the woes of so many WordPress fans.</p>
<h3>Problem: After Automatic Update the site turns white!</h3>
<p>The main culprit is the automatic upgrade feature included with WordPress 2.7. For a lot of users (me included), the automatic upgrade does not fully update and/or replace the necessary core files and actually ends up putting them in the wrong place. As a result the update is not completed and the database is not updated either.</p>
<p>The result of this is that both the public pages of the blog as well as the admin areas are replaced by white blank pages. Not exactly what you want from a simple update, right?</p>
<h4>Solution: Delete everything and do a manual install, then a manual database update</h4>
<p>Unfortunately if after the auto update your blog is gone, you have to do a manual upgrade. And I mean a <em>complete</em> manual upgrade. I&#8217;ve done this with three separate blogs now and it&#8217;s painfully obvious that for whatever reason simply replacing files does not do the job. To get things up and running again you have to fully delete your entire WordPress install from the server and then upload a fresh new version of WordPress 2.8. And that&#8217;s not all. Even after uploading a fresh version of 2.8, your site will probably still be white. To solve this you have to manually update the database by going to http://www.yoursitename.com/wp-admin/upgrade.php. Only after this is done will you have access to the front and back end.</p>
<h3>How to safely upgrade to WordPress 2.8</h3>
<blockquote><p>This is especially important for people with blogs hosted by 1and1.com</p></blockquote>
<p>If you do not like the prospect of potentially spending several hours banging your head against your desk while your blog disappears and your inbox fills up with emails from people telling you your blog is gone I strongly urge you to do a complete manual upgrade if you want to go to 2.8 right now. Or better yet, just wait until whatever it is that is causing this mess is fixed. The good people behind WordPress have published a <a title="How to upgrade WordPress manually" href="http://codex.wordpress.org/Upgrading_WordPress" target="_blank">great and easy to understand guide on how to manually upgrade WordPress</a> and I suggest you follow it to the letter (including all the backup stages &#8211; trust me, you don&#8217;t want all  your work to disappear!)</p>
<p>I&#8217;m confident that the problems that have been reported will be ironed out by the developers in a matter of days, but until then I&#8217;m going to ignore the &#8220;Please Update Now!&#8221; warning at the top of my admin panel.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/wordpress/6-must-have-wordpress-plug-ins-20081114/' rel='bookmark' title='Permanent Link: 6 Must Have WordPress Plug-ins'>6 Must Have WordPress Plug-ins</a></li>
<li><a href='http://www.designisphilosophy.com/wordpress/wordpress-27-is-just-around-the-corner-20081202/' rel='bookmark' title='Permanent Link: WordPress 2.7 to be released Dec. 4th'>WordPress 2.7 to be released Dec. 4th</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/wordpress-as-cms-the-project-20080312/' rel='bookmark' title='Permanent Link: WordPress as CMS &#8211; The Project'>WordPress as CMS &#8211; The Project</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/wordpress-28-upgrade-woes-20090611/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Anny gets shortlisted for the Best Job in the World proving the power of social media</title>
		<link>http://www.designisphilosophy.com/news/anny-gets-shortlisted-for-the-best-job-in-the-world-proving-the-power-of-social-media-20090302/</link>
		<comments>http://www.designisphilosophy.com/news/anny-gets-shortlisted-for-the-best-job-in-the-world-proving-the-power-of-social-media-20090302/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 07:33:38 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[anny chih]]></category>
		<category><![CDATA[best job in the world]]></category>
		<category><![CDATA[vancouver]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=425</guid>
		<description><![CDATA[In preparation for WordCamp Whistler 09 I threw together a website for my sister-in-law Anny Chih to support her application for the Best Job in the World. Today she found out her application is one of the 50 shortlisted from close to 35,000 videos submitted. Of course this is mostly due to the video Angela [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/my-opinion/social-media-the-end-of-objective-reason-20090825/' rel='bookmark' title='Permanent Link: Social Media: Revolution or the End of Objective Reason?'>Social Media: Revolution or the End of Objective Reason?</a></li>
<li><a href='http://www.designisphilosophy.com/applications/social-media-killed-google-wave-20100804/' rel='bookmark' title='Permanent Link: Social Media Killed Google Wave'>Social Media Killed Google Wave</a></li>
<li><a href='http://www.designisphilosophy.com/my-opinion/mastering-social-media-part-1-treat-your-blog-like-a-tv-show-20100414/' rel='bookmark' title='Permanent Link: Mastering Social Media Part 1: Treat Your Blog Like a TV Show'>Mastering Social Media Part 1: Treat Your Blog Like a TV Show</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.islandreefjob.com/anny"><img class="aligncenter" title="Vote for Anny Chih for the Best Job in the World" src="http://annychih.com/wp-content/uploads/2009/01/anny.jpg" alt="" width="425" height="319" /></a>In preparation for <a title="My WordCamp Whistler 09 presentation in easily digestible video format" href="http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/" target="_blank">WordCamp Whistler 09</a> I threw together a website for my sister-in-law <a title="Vote for Anny Chih for the Best Job in the World" href="http://www.annychih.com" target="_blank">Anny Chih</a> to support <a title="Vote for Anny Chih for the Best Job in the World" href="http://www.islandreefjob.com/anny" target="_blank">her application for the Best Job in the World</a>. Today she found out her application is one of the 50 shortlisted from close to 35,000 videos submitted. Of course this is mostly due to the video <a title="Dabbler.ca - the Vancouver video blog about anything and everything" href="http://www.dabbler.ca" target="_blank">Angela</a> and I made for her but it also shows that a sound social media strategy will pay off in the long run.</p>
<p>When we made the website we had three main goals in mind:</p>
<ol>
<li>Strong search engine presence (a.k.a. SEO a.k.a. Search Engine Optimization)</li>
<li>Striking appearance &#8211; no matter what people say, having a website that looks good increases the chances of people actually visiting and reading what&#8217;s on it</li>
<li>Harness the power of social media</li>
</ol>
<h4>Search Engine Optimization is Snake Oil &#8211; Just use WordPress and you&#8217;re good to go!</h4>
<p>The first point was a simple one. As I&#8217;ve said before and will repeat here, using WordPress as the base for your site pretty much guarantees good and relevant SEO right out of the box. And when coupled with the <a title="The All In One SEO Pack plugin for WordPress is a must" href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">All-In-One SEO Pack</a> plugin it is a veritable SEO powerhouse. The goal was to get the site to the top of Google searches for &#8220;best job in the world&#8221; and &#8220;vancouver&#8221; and that was achieved with minimal effort. I have to stress here that we did not do any SEO tricks or link pimping or anything along those lines: The site ranking is solely based on good coding and well written copy.</p>
<h4>Design with the target audience in mind and people will flock to your site</h4>
<p>The second point is always where people get stuck. And I&#8217;m no exception. But fortunately for me Anny had a very specific look in mind and with that and some of her sketches as a base it wasn&#8217;t all that hard to come up with an overall look. You can read more about the design process <a title="AnnyChih.com - a new WordPress site" href="http://www.designisphilosophy.com/wordpress/new-wordpress-based-site-annychihcom-20090130/" target="_blank">in this earlier post</a>. What&#8217;s important to note here is that the entire site design was built around quick load times, semantic code and easy editability. It was built on the <a title="Typograph - a pure CSS WordPress theme" href="http://blog.pinkandyellow.com/free-wordpress-themes/typograph/" target="_blank">Typograph</a> core and uses clean text for all its functions. I also spent a lot of time organizing the layout in such a way that it would be easy to understand and navigate for the visitors. At the end I was so happy with the overall design that I used the root of it to design my newest project <a title="Stop Living in the Past - get the code, join the movement to phase out IE6 forever" href="http://www.stoplivinginthepast.com/contact/" target="_blank">StopLivingInThePast.com</a>.</p>
<h4>Twitter &#8211; when used correctly &#8211; can be a powerful tool</h4>
<p>The third and final point was my first real experiment with social media. I <a title="Tutorial: How to create a cool Twitter box for your sidebar from scratch" href="http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/" target="_blank">added a Twitter box to my sidebar</a> a while ago and it has generated both interest and a lot of followers but I never really sat down and tried to use Twitter actively to gather interest for anything (basically because I never had anything I wanted to gather interest for). With the creation of AnnyChih.com Anny and I discussed ways to build interest for her site and her application and Twitter seemed an obvious addition. So with her handle @AnnyChih she started Tweeting actively, at first by mooching off my followers and then quickly expanding to other IslandReefJob applicants and so on and so forth. And in a week or so without any deliberate campaign to build numbers she had gained a high number of followers that were actually interested in what she had to say.</p>
<p>In addition Anny went beyond Twitter to interact with other applicants on sites dedicated to the job search and was able to build quite a following there as well. The trick on both Twitter, in forums and in blog comments was to present a mix of funny commentary, helpful advice and information. And by providing more than just blatant self promotion and random noise she built a solid following over just a few weeks.</p>
<p>Just how solid didn&#8217;t really become apparent to us until the news broke earlier today that she had been shortlisted. In a matter of minutes she was getting Tweets and comments of support from all over the place and TV and radio stations were calling her for interviews. In short order she was featured on <a title="CBC The National" href="http://www.cbc.ca/national/" target="_blank">CBCs The National</a>, <a title="Hear Anny Chih on Virgin Radio's The Rush with Buzz Bishop" href="http://vancouver.virginradio.ca/blogs/13/79" target="_blank">Virgin Radio&#8217;s The Rush</a>, <a title="Hear Anny Chih on ABC Brisbane's All-Day Breakfast" href="http://blogs.abc.net.au/queensland/2009/03/anny-chih---fin.html?program=612_breakfast" target="_blank">ABC Brisbane&#8217;s All-Day Breakfast</a> and <a title="Afternoon Buzz" href="http://www.talk1410.com/shows.php?p=1222117068.htm" target="_blank">the Afternoon Buzz on Talk 1410AM</a> largely because the Twitter community was able to get the word out.</p>
<p>So what should you get out of this long self-congratulating piece? That WordPress is a great place to start if you want your site to not only work but to get noticed, that by spending some time considering your target audience and designing your sites around them you can build a larger audience and that social media, when used correctly, can greatly enhance your brand and your reach.</p>
<h4>Now go vote!</h4>
<p>Finally I&#8217;d just like to extend my heartfelt congratulations to Anny and <span style="text-decoration: line-through;">ask</span> instruct everyone to <a title="Vote for Anny Chih for the Best Job in the World" href="http://www.islandreefjob.com/anny" target="_blank">vote now and vote often</a> (you can vote once per day from as many email addresses as you can get a hold of).</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/my-opinion/social-media-the-end-of-objective-reason-20090825/' rel='bookmark' title='Permanent Link: Social Media: Revolution or the End of Objective Reason?'>Social Media: Revolution or the End of Objective Reason?</a></li>
<li><a href='http://www.designisphilosophy.com/applications/social-media-killed-google-wave-20100804/' rel='bookmark' title='Permanent Link: Social Media Killed Google Wave'>Social Media Killed Google Wave</a></li>
<li><a href='http://www.designisphilosophy.com/my-opinion/mastering-social-media-part-1-treat-your-blog-like-a-tv-show-20100414/' rel='bookmark' title='Permanent Link: Mastering Social Media Part 1: Treat Your Blog Like a TV Show'>Mastering Social Media Part 1: Treat Your Blog Like a TV Show</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/news/anny-gets-shortlisted-for-the-best-job-in-the-world-proving-the-power-of-social-media-20090302/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New WordPress-based Site: AnnyChih.com</title>
		<link>http://www.designisphilosophy.com/wordpress/new-wordpress-based-site-annychihcom-20090130/</link>
		<comments>http://www.designisphilosophy.com/wordpress/new-wordpress-based-site-annychihcom-20090130/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 07:27:43 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=334</guid>
		<description><![CDATA[Two weekends ago my sister-in-law Anny Chih asked for some help sprucing up her WordPress blog. She wanted to apply for The Best Job in the World &#8211; the Tourism Queensland online video contest where you post a 1 minute video application to become the island caretaker of the beautiful Hamilton Island in Australia &#8211; [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/' rel='bookmark' title='Permanent Link: Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?'>Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.annychih.com"><img class="aligncenter size-full wp-image-335" title="AnnyChih.com" src="http://www.designisphilosophy.com/wp-content/uploads/2009/01/annychih.jpg" alt="AnnyChih.com" width="506" height="417" /></a>Two weekends ago my sister-in-law <a title="Anny Chih for the best job in the world" href="http://www.annychih.com" target="_blank">Anny Chih</a> asked for some help sprucing up her WordPress blog. She wanted to apply for<a title="Anny Chih's application for the Best Job in the World" href="http://bit.ly/anny" target="_blank"> The Best Job in the World</a> &#8211; the <a title="The Best Job in the World" href="http://islandreefjob.com" target="_blank">Tourism Queensland online video contest</a> where you post a 1 minute video application to become the island caretaker of the beautiful Hamilton Island in Australia &#8211; and use the blog to showcase her talents and provide information about both herself and the islands.</p>
<p>Her blog was running the default theme but she wanted something that reflected the contest and also her own sunny disposition. She sketched up a rough draft in PhotoShop and let me get to work on it. I set aside one day to finish the entire redesign (totally crazy) and here is the result.</p>
<h3>WordPress as CMS</h3>
<p>Off the top you&#8217;ll notice I switched the front page to a static one to showcase the video and some info about the contest and Anny herself. The blog portion of the site has been moved to the back end and is accessible from the main menu and also from the Recent Posts box on the bottom right hand side.</p>
<h3>Custom Field Boxes</h3>
<p><img class="aligncenter size-full wp-image-336" title="Custom Fields" src="http://www.designisphilosophy.com/wp-content/uploads/2009/01/customfields.jpg" alt="Custom Fields" width="506" height="139" />At the bottom of the front page there are three boxes containing from left to right info on the contest, Anny&#8217;s 4 most recent tweets and the titles of the 5 most recent posts. The three fields are populated using custom fields from within the WordPress admin area so that they can easily be changed later. In the case of the Twitter box it is populated using the technique outlined in my <a title="How to create a twitter box in your sidebar" href="http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/" target="_blank">Create a Twitter Box in Your Sidebar tutorial</a>.</p>
<p>I used this site as an example during <a title="WordCamp Whistler" href="http://wordcampwhistler.com" target="_blank">WordCamp Whislter</a> last weekend to demonstrate how you can <a title="Using custom fields in WordPress to create advanced layouts" href="http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts-20081219/" target="_blank">use custom fields for advanced layouts</a>. The entire talk with code examples will be posted over the weekend.</p>
<h3>Subtle Graphic Effects</h3>
<p>I usually spend a lot of time making sure the sites I design have compelling and interesting graphics. In the case of Design is Philosophy I took the principle to the extreme but on AnnyChih.com I focused more on subtlety. For example, the background graphic with the bubbles is separated from the header image so that if you change the size of the browser window you&#8217;ll see the two images moving independently of each other. It&#8217;s a very subtle effect but it means that even people using smaller screens see the circle graphic Anny came up with.</p>
<p>Within the pages and posts I&#8217;ve also added graphic elements like the glowing underlines using CSS. It&#8217;s a simple trick that makes the content look more refined than simple solid lines.</p>
<h3>Threaded Comments</h3>
<p><img class="alignleft size-full wp-image-337" title="Threaded comments" src="http://www.designisphilosophy.com/wp-content/uploads/2009/01/threadedcomments.jpg" alt="Threaded comments" width="211" height="137" /><br />
One of the major upgrades in WordPress 2.7 was the inclusion of threaded comments. By activating and styling this fucntionality the visitors to the site now have the ability to carry on conversations without being confused by the comment order. Again it&#8217;s a subtle effect that greatly enhances the experience for the visitor.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/new-wordpress-based-site-the-readers-companion-20081002/' rel='bookmark' title='Permanent Link: New WordPress based site: The Reader&#8217;s Companion'>New WordPress based site: The Reader&#8217;s Companion</a></li>
<li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/' rel='bookmark' title='Permanent Link: Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?'>Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/wordpress/new-wordpress-based-site-annychihcom-20090130/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Speaking about WordPress as CMS at WordCamp Whistler &#8211; What do you want me to cover?</title>
		<link>http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/</link>
		<comments>http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 20:09:11 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[speaking engagements]]></category>
		<category><![CDATA[wordcamp]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=309</guid>
		<description><![CDATA[I am speaking at WordCamp Whistler on January 24th on the topic of using WordPress to create, design and manage &#8220;non-blog&#8221; web sites &#8211; in other words using WordPress as a CMS. If you follow this blog you know that I&#8217;ve been working with this concept for a long time and that in almost every [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/news/wordcamp-whistler-wordpress-as-cms-20081219/' rel='bookmark' title='Permanent Link: WordCamp Whistler Pitch: Moving Beyond the Blog &#8211; Building Web Sites with WordPress as the CMS'>WordCamp Whistler Pitch: Moving Beyond the Blog &#8211; Building Web Sites with WordPress as the CMS</a></li>
<li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/' rel='bookmark' title='Permanent Link: Code snippets from my WordCamp presentation'>Code snippets from my WordCamp presentation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wordcampwhistler.com"><img class="aligncenter" title="WordCamp Whistler" src="http://www.wordcampwhistler.com/wp-content/themes/minimalia/images/header.jpg" alt="" width="507" height="166" /></a>I am speaking at <a title="WordCamp Whistler - get your tickets now!" href="http://www.wordcampwhistler.com/" target="_blank">WordCamp Whistler on January 24th</a> on the topic of using WordPress to create, design and manage &#8220;non-blog&#8221; web sites &#8211; in other words using <a title="All my articles on WordPress as CMS" href="http://blog.pinkandyellow.com/category/wordpress-as-cms/" target="_blank">WordPress as a CMS</a>. If you follow this blog you know that I&#8217;ve been working with this concept for a long time and that in almost every case I use WordPress as a base for my client sites. There are many reasons for this, foremost that from a client perspective it is more user friendly than any of the other open-source CMSes out there. Add to that the almost infinite extensibility through plug-ins and other hacks and how easy it is to create custom themes and layouts and you have what in my view is the best backend solution for small and medium scale web projects.</p>
<p>In <a title="My WordCamp Whistler pitch" href="http://blog.pinkandyellow.com/news/wordcamp-whistler-wordpress-as-cms-20081219/" target="_blank">my original pitch</a> I asked for a one hour session. But unbeknownst to me <a title="Tris Hussey on his talk at WordCamp Whistler" href="http://www.trishussey.com/2009/01/12/getting-ready-for-wordcamp-whistler-what-are-your-favourite-themes-and-plugins/" target="_blank">Tris Hussey</a> (who is looking for your input on favourite plug-ins etc), another WordPress as CMS expert, had pitched almost the exact same topic to the event. Rather than pick sides and give one of us the full hour, it was decided that we would each get a 30 minute session so we both get our foot in and the attendees can get two different perspectives. Which is a great idea: This is by no means an exact science and while I&#8217;m sure Tris and my approaches compliment each other they will be vastly different. And that &#8220;double perspective&#8221; will give the listeners a far broader understanding of the subject matter than if one of us were to do the session by ourselves.</p>
<h3>So what should I talk about?</h3>
<p>With the reduced time comes the inevitable question: What should I talk about? Those who know me know that I will take up whatever time I am given and I&#8217;ll always have plenty more to say. In the case of WordPress as CMS I could probably hold a week long seminar and still only cover the basics of what you can do. In <a title="My WordCamp Whistler pitch" href="http://blog.pinkandyellow.com/news/wordcamp-whistler-wordpress-as-cms-20081219/" target="_blank">my original pitch</a> I outlined a series of topics that form the foundation of this technique. These include basic WordPress anatomy, theme and CSS hacks, taxonomy, custom templates, custom themes and a discussion of why WordPress is the ideal platform for &#8220;regular&#8221; web sites.</p>
<p>I could talk at length on all of these topics but I think the attendees would be better served with a broader approach that covers the basics of several of them for further study later on.</p>
<h3>What do <em>you</em> want to learn?</h3>
<p>Rather than set my talk in stone right now, I&#8217;d like to hear from the people who are actually going to the event and let them shape the session. So what do you want me to talk about? What do you think you would have the most use of? WordPress anatomy? <a title="Using WordPress custom fields as layout tools" href="http://blog.pinkandyellow.com/tutorials/using-conditional-custom-fields-for-advanced-layouts-20081219/" target="_blank">Custom fields as layout tools</a>? Theme hacks? Taxonomy? The choice is yours. Here is a preliminary break down of the session and then I&#8217;ll let you, the listener, decide the final result:</p>
<h3>Working Title: WordPress as CMS &#8211; Building the Non-Blog WordPress Site of the Future</h3>
<p>Suggested topics covered:</p>
<h4>WordPress Anatomy</h4>
<p>What does WordPress really do? How does the stuff you create in the back-end end up on the pages and posts? What is the difference between posts, pages, indexes and all the other options? And how are these things connected?</p>
<h4>The Basic Hack: Custom Templates</h4>
<p>Want more control of the appearance of your pages? Custom templates give you complete control with minimum effort. Learn some basic theme hacks and understand the template structure.</p>
<h4>Custom Fields Can Be Used for Anything!</h4>
<p>One of the most powerfull and underused functions in WordPress is the Custom Fields. By understanding how they work you can use them as a layout tool to create menus, boxes and other elements that will make your site stand out.</p>
<h4>Make the WordPress Taxonomy Work for You</h4>
<p>The WordPress <a title="What does Taxonomy really mean?" href="http://en.wikipedia.org/wiki/Taxonomy" target="_blank">taxonomy</a> (hierarchial structure, i.e. categories, sub categories etc) was built for blogging. But if you reframe your thinking of what blogging really is you&#8217;ll see that the same taxonomy combined with page parenting gives you a solid base for non-blog taxonomy and dynamic page creation.</p>
<blockquote><p>That&#8217;s what I have. Now it&#8217;s up to you! Drop your thoughts in the comments below and together we&#8217;ll create a session customized to the people who are there to learn.</p></blockquote>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/news/wordcamp-whistler-wordpress-as-cms-20081219/' rel='bookmark' title='Permanent Link: WordCamp Whistler Pitch: Moving Beyond the Blog &#8211; Building Web Sites with WordPress as the CMS'>WordCamp Whistler Pitch: Moving Beyond the Blog &#8211; Building Web Sites with WordPress as the CMS</a></li>
<li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/' rel='bookmark' title='Permanent Link: Code snippets from my WordCamp presentation'>Code snippets from my WordCamp presentation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/events/speaking-about-wordpress-as-cms-at-wordcamp-whistler-what-do-you-want-me-to-cover-20090112/feed/</wfw:commentRss>
		<slash:comments>5</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-20081219/</link>
		<comments>http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts-20081219/#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 Themes]]></category>
		<category><![CDATA[wordpress]]></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 on how the WordPress theme has been set up: Custom fields can be used for [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/' rel='bookmark' title='Permanent Link: Code snippets from my WordCamp presentation'>Code snippets from my WordCamp presentation</a></li>
<li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/' rel='bookmark' title='Permanent Link: Build a fancy WordPress author box'>Build a fancy WordPress author box</a></li>
</ol>]]></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>0<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>1<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>



<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/' rel='bookmark' title='Permanent Link: Code snippets from my WordCamp presentation'>Code snippets from my WordCamp presentation</a></li>
<li><a href='http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/' rel='bookmark' title='Permanent Link: Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation'>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</a></li>
<li><a href='http://www.designisphilosophy.com/tutorials/build-a-fancy-wordpress-author-box-20100507/' rel='bookmark' title='Permanent Link: Build a fancy WordPress author box'>Build a fancy WordPress author box</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/using-conditional-custom-fields-for-advanced-layouts-20081219/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
