<?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; Tutorials</title>
	<atom:link href="http://www.designisphilosophy.com/category/tutorials/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>Tue, 24 Aug 2010 16:40:33 +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>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>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>Build a fancy author or profile box with Expression Web</title>
		<link>http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/</link>
		<comments>http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 20:54:56 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Expression Web]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=716</guid>
		<description><![CDATA[A profile box is a great way of quikcly giving your visitors information about a person featured on your site. These boxes normally feature a quote or short biography followed by the person&#8217;s name, affiliation and maybe a photo and usually are just straight up blockquotes or something similar. In other words they are a [...]


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/microsoft-expression-web/fancy-interactive-pure-css-list-boxes-with-hover-effect-20080503/' rel='bookmark' title='Permanent Link: Fancy Interactive Pure CSS List Boxes with Hover Effect'>Fancy Interactive Pure CSS List Boxes with Hover Effect</a></li>
<li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-717" title="Fancy profile box featuring Tracy Sullivan of DesignSchooledKids.com" src="http://www.designisphilosophy.com/wp-content/uploads/2010/04/testimonial-layout.jpg" alt="" width="506" height="246" />A profile box is a great way of quikcly giving your visitors information about a person featured on your site. These boxes normally feature a quote or short biography followed by the person&#8217;s name, affiliation and maybe a photo and usually are just straight up blockquotes or something similar. In other words they are a bit boring. But there really is no reason why they should be: Text and images on the web can pretty much be displayed in any layout you want. All you need is the creativity to come up with a better way of displaying it and either the knowledge of CSS and HTML to get it done or a tool to help you along the way.</p>
<p>In this tutorial I&#8217;ll show you how to build the fancy profile box pictured above and featured on the <a title="Pink &amp; Yellow Media - WordPress design and development in Vancouver" href="http://pinkandyellow.com/testimonials/" target="_blank">testimonial page on the Pink &amp; Yellow Media website</a> using Expression Web. If you don&#8217;t use Expression Web you can still follow along and use the code so don&#8217;t worry. <a title="Demo of Fancy Profile Box" href="http://designisphilosophy.com/tutorials/FancyProfile/fancy_profile_box.html" target="_blank">Click here to see a working demo</a> (opens in new tab or window).</p>
<h3>Start with a design</h3>
<p>The image above is actually the real Photoshop mockup I did for the project (if you look closely you&#8217;ll see that Tracy&#8217;s photo is blurry because I kept scaling it up and down to get the size right). I mock up all my projects, even if they are just small ones like this, in either Photoshop or Expression Design to have a quick way of altering the layout and design until I find something I like.</p>
<p>The completed design also serves another equally important purpose: With the layout done it&#8217;s easier to map out how the HTML and CSS needs to be organized to get the dynamic web content to match the static image. In it&#8217;s most basic form HTML works by wrapping content in boxes and CSS styles those boxes. Therefore mapping out what boxes are needed right on the design like below makes it a lot easier to figure out the next several steps.</p>
<h3><img class="aligncenter size-full wp-image-718" title="chopped" src="http://www.designisphilosophy.com/wp-content/uploads/2010/04/chopped.jpg" alt="" width="506" height="227" />Building the HTML markup</h3>
<p>The boxed out image above gives us a clear indication of how the markup needs to be organized:</p>
<ul>
<li>There&#8217;s a box that contains everything that has a grey border</li>
<li>The quote itself has to be contained within it&#8217;s own box</li>
<li>The profile info (name, affiliation, image) needs to be wrapped in its own box</li>
<li>The name is separate from the affiliation and needs its own box</li>
<li>The image needs to float on top of other content, namely the blue background banner</li>
</ul>
<p>From this we can start building the markup. I usually start working with actual content right away but I&#8217;ve been told most people get confused by this method so I&#8217;m going to recommend building the HTML framework first and then inputting the content. The next steps take place in Code view.</p>
<p>As step zero create a container to simulate the width of your website. This is just to make sure that the box expands and contracts properly when it&#8217;s done. To do this go into Code view and create a new line directly under the &lt;body&gt; tag. Type &lt;div id=&#8221;container&#8221;&gt; and Expression Web creates the end &lt;/div&gt; tag for you. Hit Return several times to create space between the beginning and end tag.</p>
<p><em><strong>A smart tip: To keep track of what tag closes what div insert a  comment after each of the closing divs expalining what that is, for  example &lt;/div&gt; &lt;!&#8211; END #container &#8211;&gt;</strong></em></p>
<p>Create a new line under the div you just created and create a new div, this time with the class <em>profile</em> like this &lt;div class=&#8221;profile&#8221;&gt;. This div is the outer wrap for the actual box. Again hit Return several times to make space between the beginning and end tag and identify the end tag with the comment &lt;!&#8211; END .profile &#8211;&gt;.</p>
<p>Create a box for the profile text by creating a new div inside the profile div with the class <em>profileText</em>.</p>
<p>Underneath the profileText div (<em>not</em> inside it) create a new box to contain the name, image and affiliation. Give this div the class <em>profileStats</em>.</p>
<p>Inside the profileStats div create two new separate divs with the classes <em>profileName</em> and <em>profileJob</em> respectively.</p>
<p>The framework is now complete and should look like the code example below. Notice how I use tab indents to visually show how elements are nested within eachother:</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;">body</span>&gt;</span>
<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;container&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;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;<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;<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;<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: #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;<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 #container --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div>

<h3>Insert the content</h3>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2010/04/completemarkup.jpg"><img class="alignright size-medium  wp-image-719" title="Complete markup" src="http://www.designisphilosophy.com/wp-content/uploads/2010/04/completemarkup-300x218.jpg" alt="" width="300" height="218" /></a>With the framework all mapped out it&#8217;s time to insert some content. In Expression Web go to Split view. You&#8217;ll notice that in the Design view portion there are now three boxes with dotted outlines. Clicking on each of these will show you what box you have selected. At the same time you&#8217;ll see where you are in the framework structure in the Code view portion so you always know you are typing out content in the right place. Now you can insert your content in the different boxes. The bio, profile, quote or testimonial goes in the profileText box, the name of the person goes in the profileName box and the affiliation stats (position, company, website etc) goes in the profileJob box.</p>
<p><em><strong>The image in this tutorial is 88px by 88px. To personalize this tutorial you should make your own image to use.</strong></em></p>
<p>When it comes to the image it doesn&#8217;t really matter exactly where you insert it (you&#8217;ll see why later). But for structural purposes it should be within the profileStats box. To insert it place your cursor directly after the opening tag of the profileStats div and hit Return to create a new line. Click Insert on the main menu, select Picture and From File to open the Picture dialog. From here select the image you want to display and click Open. This will insert the image into your code. The image to the right shows the markup in Code view and what the cntent currently looks like in Design view (click for full size version). Below is the markup at this point:</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;">body</span>&gt;</span>
<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;container&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;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>		
			If there was a need for a Word Press Superhero [and there is] Morten 
			would be your guy.<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
			Pink <span style="color: #ddbb00;">&amp;amp;</span> Yellow Media took on the Design Schooled Kids website 
			project because it would push Word Press to its very limits in both 
			look and functionality. We presented them with a design and it they 
			made it a reality – BIG TIME!<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
			Without hesitation I would highly recommend Pink <span style="color: #ddbb00;">&amp;amp;</span> Yellow Media.<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;<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;tracyPic.jpg&quot;</span> <span style="color: #66cc66;">/</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>
				Tracy Sullivan<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>
				Principal <span style="color: #ddbb00;">&amp;amp;</span> Creative Director <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</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;http://www.designschooledkids.com&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Design Schooled Kids&quot;</span>&gt;</span>
				Design Schooled Kids<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;<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 #container --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div>

<h3>Styling the content</h3>
<p>You now have the complete markup for the page. The next step is to create the styles that will make the box look the way you want it to.</p>
<p>Again step zero is to simulate the width of an actual site: On the right hand side of Expression Web you should have a series of panels, probably Toolbox, Apply Stles and Manage Styles. Close Toolbox and Apply Styles (you can always open them again from Panels on the main menu). I do 99% of my work from the Manage Styles panel. In the Manage Styles panel click <strong>New Style</strong> to open the New Style dialog. For the Selector type <em>#container</em> (the # sign means ID while a punctuation mark means Class). Go to <strong>Position</strong> and set the <strong>width</strong> to whatever width you are going to work with. In my case it is <em>506px</em>. Click <strong>OK</strong> to apply the style. You should now see that the box is narrower than it was before.</p>
<h4>.profile</h4>
<p><a href="http://www.designisphilosophy.com/wp-content/uploads/2010/04/profile-style.jpg"><img class="alignright size-medium wp-image-720" title="profile style" src="http://www.designisphilosophy.com/wp-content/uploads/2010/04/profile-style-300x288.jpg" alt="" width="300" height="288" /></a>The .profile class is the outer box that wraps the content. From the image at the top of the article we see it is supposed to have a grey border. If you want to, Expression Web will help you assign selector names to your styles. Click on any of the content in Design view and use the Tag Selector up at the top to highlight the &lt;div.profile&gt; tag. Now click on New Style in the Manage Styles panel and Expression Web will automatically set the <strong>Selector name</strong> to <em>.profile</em>. All you have to do here is go to <strong>Border</strong> and set all four sides to <em>solid</em>, <em>1px</em> and <em>#CCCCCC.</em> Click <strong>OK</strong> to apply the style and you&#8217;ll see the content now has a grey border around it.</p>
<h4>.profileText</h4>
<p>You may have noticed you didn&#8217;t add padding to the .profile box to give the text some breathing space. This is because that padding would have affected the blue bar at the bottom of the box. You&#8217;ll see later. To create some breathing space for the profile text and set the font family create a new style with the selector <em>.profileText</em>. Under <strong>Box</strong> set <strong>Padding</strong> for all four sides to <em>10px</em>. Under <strong>Font</strong> set the <strong>font-family</strong> to <em>Arial, Helvetica, sans-serif</em> and <strong>font-size</strong> to <em>o.8em</em>. Click <strong>OK </strong>and the text will indent and change font family.</p>
<h4>.profileStats</h4>
<p>The name and position in the design is a serif font and aligned to the right. This can be done in the respective styles for the individual elements or as we do it here in the overall style: Create a new style with the selector <em>.profileStats</em>, set the <strong>font-family</strong> to <em>Georgia, Times New Roman, Times, serif</em> and <strong>font-style</strong> to <em>italic</em>. To change the text alignment go to <strong>Block</strong> and set <strong>text-align</strong> to <em>right</em>.</p>
<h4>.profileStats img</h4>
<p>Right now the image appears above the rest of the profile stats. The design calls for it to appear in the bottom right corner. To do this we&#8217;re going to use absolute positioning. Create a new style with the selector <em>.profileStats img</em>. This style will only target the image. Go to <strong>Position</strong> and set <strong>Position</strong> to <em>absolute</em>, <strong>right</strong> to <em>0px</em> and <strong>bottom</strong> to <em>0px</em>. The absolute positioning &#8216;lifts&#8217; the affected content out of the regular stream and positions it based on XY coordinates within the page, in this case 0px from the right and 0px from the bottom so the bottom right corner. But when you click on OK you&#8217;ll see that the image places itself in the bottom right coner of the page, not the box. This is because an absolutely positioned element will relate itself to the first containing element that has a position value set to something other than <em>static</em> which is the default value. Since there are no such elements it relates itself to the window itself. To fix this we need to change the <strong>Position</strong> value of the .profile box. To do this go to the Manage Styles panel, right click the .profile style and select <em>Modify Style</em> from the pop up menu. In the Modify Style dialog go to <strong>Position</strong> and set <strong>position</strong> to <em>relative</em>. Click <strong>OK</strong> and the image now appears in the bottom right hand corner of the box. But now it overpals the name and affiliation text. So that&#8217;s what we&#8217;ll fix next.<a href="http://www.designisphilosophy.com/wp-content/uploads/2010/04/imagecover.jpg"><img class="aligncenter size-full wp-image-722" title="imagecover" src="http://www.designisphilosophy.com/wp-content/uploads/2010/04/imagecover.jpg" alt="" width="506" height="179" /></a></p>
<h4>.profileName</h4>
<p>To shift the profile name out from under the image create a new style with the selctor name <em>.profileName</em>, go to <strong>Box</strong> and set <strong>padding-right</strong> to <em>98px</em> (88px for the image widht plus 10px for some breathing space). At the same time set <strong>padding-bottom</strong> to <em>5px</em>. Under <strong>Font</strong> set <strong>font-size</strong> to <em>1.2em</em>, <strong>font-weight</strong> to <em>bold</em> and <strong>color</strong> to <em>#2e4672</em>.  Click <strong>OK</strong> to apply the new style.</p>
<h4>.profileJob</h4>
<p>This is where that blue stripe in the design comes in. The blue is actually a tiny .gif image tiled to the right and used as a background. Create a new style with the selector <em>.profileJob</em>. Let&#8217;s fix the text first: Set <strong>font-size</strong> to <em>0.8em</em>, <strong>color</strong> to <em>#FFFFFF</em> and under <strong>Box</strong> set <strong>padding-right</strong> to <em>98px</em> and <strong>padding-top</strong> to <em>5px.</em> To add the blue background go to <strong>Background</strong>, set <strong>background-image</strong> to <em>testimonialBlue.gif</em> (<a title="blue background image" href="http://designisphilosophy.com/tutorials/FancyProfile/testimonialBlue.gif" target="_blank">image file</a>) and set <strong>background-repeat</strong> to <em>repeat-x</em>. Finally because the design calls for the blue banner to be 50px tall go to <strong>Position</strong> and set <strong>height</strong> to <em>45px</em>. It&#8217;s set to 45 rather than 50 because the padding is added on to the height and you already added 5px earlier. Setting <strong>height</strong> to 50px would mean the box is actually 55px tall.</p>
<h4>.profileJob a</h4>
<p>Finally to style the link create a new style with the selector name  <em>.profileJob a</em>. Set <strong>font-weight</strong> to <em>bold</em>, <strong>color</strong> to <em>#FFFFFF</em> and check <em>none</em> under <strong>text-decoration</strong>.</p>
<h3>Final thoughts</h3>
<p>This box is fairly easy to implement in both static and dynamic sites. I have it running under WordPress on our company website though I had to create a special style for the paragraph tag to get that to work properly. The box is stested against all major browsers and works properly. The only divergence is a 1px shift of the image in Internet Exprlorer 6 which I think is acceptable.</p>
<h3>Final HTML Markup</h3>

<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;">body</span>&gt;</span>
<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;container&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;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>		
			If there was a need for a Word Press Superhero [and there is] Morten 
			would be your guy.<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
			Pink <span style="color: #ddbb00;">&amp;amp;</span> Yellow Media took on the Design Schooled Kids website 
			project because it would push Word Press to its very limits in both 
			look and functionality. We presented them with a design and it they 
			made it a reality – BIG TIME!<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
			Without hesitation I would highly recommend Pink <span style="color: #ddbb00;">&amp;amp;</span> Yellow Media.<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;<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;tracyPic.jpg&quot;</span> <span style="color: #66cc66;">/</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>
				Tracy Sullivan<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>
				Principal <span style="color: #ddbb00;">&amp;amp;</span> Creative Director <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</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;http://www.designschooledkids.com&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Design Schooled Kids&quot;</span>&gt;</span>
				Design Schooled Kids<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;<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 #container --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div>

<h3>Final CSS markup</h3>

<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;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span>
#container {
	width: 506px;
}
.profile {
	border: 1px solid #CCCCCC;
	position: relative;
}
.profileText {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 0.8em;
	padding: 10px;
}
.profileStats {
	font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;
	font-style: italic;
	text-align: right;
}
.profileStats img {
	position: absolute;
	right: 0px;
	bottom: 0px;
}
.profileName {
	padding-bottom: 5px;
	padding-right: 98px;
	font-size: 1.2em;
	font-weight: bold;
	color: #2e4672;
}
.profileJob {
	font-size: 0.8em;
	padding-right: 98px;
	padding-top: 5px;
	background-image: url('testimonialBlue.gif');
	background-repeat: repeat-x;
	height: 45px;
	color: #FFFFFF;
}
.profileJob a {
	color: #FFFFFF;
	font-weight: bold;
	text-decoration: none;
}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></pre></div></div>



<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/microsoft-expression-web/fancy-interactive-pure-css-list-boxes-with-hover-effect-20080503/' rel='bookmark' title='Permanent Link: Fancy Interactive Pure CSS List Boxes with Hover Effect'>Fancy Interactive Pure CSS List Boxes with Hover Effect</a></li>
<li><a href='http://www.designisphilosophy.com/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/microsoft-expression-web/fancy-profile-box-with-expression-web-20100423/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative</title>
		<link>http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/</link>
		<comments>http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 17:12:34 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[My Book]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=577</guid>
		<description><![CDATA[My new book Sams Teach Yourself Microsoft Expression Web 3 in 24 Hours is nearing completion (just finished final review of the first 10 chapters last night). The book is a revision of the original for the new version of Expression Web and in the rewriting process I also added some new content to help [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/expression-web-3-service-pack-1-now-available-20091120/' rel='bookmark' title='Permanent Link: Expression Web 3 Service Pack 1 now available'>Expression Web 3 Service Pack 1 now available</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/previewing-silverlight-applications-in-your-browser-with-expression-development-server-20080803/' rel='bookmark' title='Permanent Link: Previewing Silverlight Applications in Your Browser With Expression Development Server'>Previewing Silverlight Applications in Your Browser With Expression Development Server</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression/expression-web-what-a-bug-already-20070626/' rel='bookmark' title='Permanent Link: Expression Web &#8211; What? A Bug Already?'>Expression Web &#8211; What? A Bug Already?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>My new book <a title="Learn Microsoft Expression Web 3 with this great book" href="http://bit.ly/3MpKBB" target="_blank">Sams Teach Yourself Microsoft Expression Web 3 in 24 Hours</a> is nearing completion (just finished final review of the first 10 chapters last night). The book is a revision of the original for the new version of Expression Web and in the rewriting process I also added some new content to help the readers better understand the sometimes confusing and mysterious world of web code. These additions were mostly brought forth by questions and comments from readers as is the case with the excerpt below about hyperlink syntax.</p>
<p>I chose this excerpt because it is relevant not only to people who use Expression Web 3 but to anyone who does anything on the web. When I started out in this field I was often confused about why there were three different types of hyperlinks and how and when to use them. Well, here is a straight forward explanation with examples:</p>
<h3>Absolute, Relative and Root-relative Hyperlinks &#8211; an explanation</h3>
<p>As you are creating hyperlinks in Expression Web 3, you will notice that the syntax of the link address in the Code view changes depending on what you link to. There are actually three different ways of writing a hyperlink address, all of which are used for different purposes:</p>
<h4>Absolute Hyperlinks</h4>
<p>Absolute hyperlinks are complete addresses that contain all the elements of a URL. They always start with some version of http:// followed by the domain name (for example, www.designisphilosophy.com) and optionally a page/folder. Absolute hyperlinks are used when linking to pages outside of the current site that have a different domain name.</p>
<h4>Relative Hyperlinks</h4>
<p>Relative hyperlinks are addresses that are relative to the current domain or location. They only contain the name of the target page prefixed with any necessary folder moves (for example, default.html). The browser sees that this is a relative hyperlink and adds the domain and folder location of the current page to the beginning of the link to complete it. If you use relative hyperlinks and you want to navigate from a page stored in one folder to a page stored in a different folder you add the folder prefixes to the hyperlink. For instance, a relative link from a page in Folder 1 to a page in Folder 2 would be ../Folder 2/page.html, where the ../ tells the browser you want to go out of the current folder and into a new one. When you create hyperlinks between pages in Expression Web 3, they are always inserted as relative links so that the application can easily update them if you choose to move files around. However, if you move the files around on your computer outside of the Expression Web program, the hyperlinks break.</p>
<h4>Root-relative Hyperlinks</h4>
<p>Root-relative hyperlinks are a subset of relative hyperlinks in which all the links are assumed to start from the root folder (domain name) of the site. They differ from the relative hyperlinks in that the address is prefixed by a forward slash (for example, /default.html). The browser applies only the domain to the beginning of this link. Root-relative hyperlinks are used in place of relative ones in large sites in which there is a chance the files will be moved around without using an application such as Expression Web 3 to update them. Because they refer to the root of the site rather than the current location of the page they are placed in, they work regardless of where the file is placed as long as they remain under the right domain.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/expression-web-3-service-pack-1-now-available-20091120/' rel='bookmark' title='Permanent Link: Expression Web 3 Service Pack 1 now available'>Expression Web 3 Service Pack 1 now available</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/previewing-silverlight-applications-in-your-browser-with-expression-development-server-20080803/' rel='bookmark' title='Permanent Link: Previewing Silverlight Applications in Your Browser With Expression Development Server'>Previewing Silverlight Applications in Your Browser With Expression Development Server</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression/expression-web-what-a-bug-already-20070626/' rel='bookmark' title='Permanent Link: Expression Web &#8211; What? A Bug Already?'>Expression Web &#8211; What? A Bug Already?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why a CSS Reset should be at the core of your stylesheet</title>
		<link>http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet-20090817/</link>
		<comments>http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet-20090817/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 23:30:20 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=567</guid>
		<description><![CDATA[The CSS Reset is a little known and often overlooked tool in web design that makes cross-browser and cross-platform compatibility a lot easier. It also ensures that you start with a clean sheet when building CSS-based web sites, whether they be single pages, static sites, WordPress sites or anything else. In my view the CSS [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/' rel='bookmark' title='Permanent Link: HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative'>HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/center-a-page-horizontally-using-css-an-expansion-20080322/' rel='bookmark' title='Permanent Link: Center a Page Horizontally Using CSS &#8211; An Expansion'>Center a Page Horizontally Using CSS &#8211; An Expansion</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>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-570" title="CSS Reset" src="http://www.designisphilosophy.com/wp-content/uploads/2009/08/cssreset.jpg" alt="CSS Reset" width="506" height="246" />The <a title="Eric A. Meyer's CSS Reset Reloaded" href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">CSS Reset</a> is a little known and often overlooked tool in web design that makes cross-browser and cross-platform compatibility a lot easier. It also ensures that you start with a clean sheet when building CSS-based web sites, whether they be single pages, static sites, WordPress sites or anything else. In my view the CSS reset is so important that web designers, even those just starting out, should use it at all times and make it the foundation of any and all style sheets they create. In fact the employment of the CSS Reset is a main tenant in both my books on Expression Web 2 and Expression Web 3 and is the basis of all my own design projects including the <a title="Free WordPress theme Typograph" href="http://wordpress.org/extend/themes/typograph" target="_blank">free WordPress theme Typograph</a>.</p>
<h3>Why do I need a CSS Reset?</h3>
<p>If you&#8217;ve never worked with a CSS Reset before I can pretty much guarantee that the question you are itching to ask is &#8220;why do I need a CSS Reset&#8221;. After all, you&#8217;ve designed or worked with numerous CSS-based sites in the past and even though they didn&#8217;t have a CSS Reset they work just fine. Right? Well, let me ask you this: If you&#8217;ve ever tried to design a site from scratch using CSS, and you&#8217;ve tried to make it cross-browser compatible, you&#8217;ve probably noticed that your styles don&#8217;t always look the same in different browsers even though they should. In most cases this has been a Internet Explorer vs. the rest type of battle and you&#8217;ve probably written it off as such and just picked a side. But that&#8217;s not the only, or right for that matter, solution. If you run into a browser incompatibility issue where CSS is concerned, it&#8217;s more often than not due to the fact you haven&#8217;t properly defined your styles leaving it up to the respective browser to make guesses as to what you want the site to look like.</p>
<p>To put it in simpler terms: If you don&#8217;t define all the default CSS parameters in your style sheet, the browser will use its default parameters instead. And since different browsers have different parameters your site will end up looking different depending on what browser you use.</p>
<h3>What does the CSS Reset do?</h3>
<p>As the name suggests, the CSS Reset resets all the default CSS parameters to a neutral position thus overriding any predefined assumptions at the hands of the browser. That&#8217;s a bit of a vague explanation so I&#8217;ve made a visual example that illustrates it perfectly:</p>
<p><img class="aligncenter size-full wp-image-568" title="CSS Reset example" src="http://www.designisphilosophy.com/wp-content/uploads/2009/08/css-reset-example.jpg" alt="CSS Reset example" width="506" height="556" /></p>
<p>The image above shows the same piece of basic HTML displayed when no CSS is defined and when the CSS Reset is applied. It is pretty obvious what happens: When you create a HTML page with some basic tags like &lt;h1&gt;, &lt;p&gt;, &lt;blockquote&gt; and &lt;ul&gt; without defining the styles of these tags with CSS, the browser applies its default stylesheet to these tags. But like I said earlier, different browsers have different standard stylesheets and as a result the page won&#8217;t look the same across all browser. And although this isn&#8217;t really a big problem when we&#8217;re talking super-basic stuff like what is displayed above, it becomes a serious pain in the neck when you create complicated CSS layouts.</p>
<h3>So all I&#8217;m doing is creating more work for myself?</h3>
<p>Unfortunately the gut reaction from a lot of people when they see the image above is &#8220;Oh crap! Why would I ever do that? I just create tons of work for myself.&#8221; Well, that&#8217;s partly true: With a CSS Reset applied you do have to manually define all your styles unless you like the reset look (I don&#8217;t). But on the bright side that also means you are now in complete control of every aspect of your site and nothing is left to chance any more. And in my book the former far outweighs the latter.</p>
<p>If that doesn&#8217;t convince you, consider this: Before I startet using the CSS Reset in all my projects, I spent a lot of time trying to jury rig my code into playing nice in all browsers. This often included using IE hacks and JavaScript. After emplying the CSS Reset I only rarely encounter these problems, and when I do it&#8217;s usually because I made a mistake somewhere.</p>
<h3>Alright, I&#8217;m sold. How do I start using the CSS Reset?</h3>
<p>There are several CSS Resets available out there. The one I use is CSS guru Eric A. Meyer&#8217;s <a title="Eric A. Meyer's CSS Reset Reloaded" href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">Reset Reloaded</a>. It seems to be the most comprehensive reset and it is constantly being updated. To employ it I simply copy the code from the site and paste it in at the very top of my stylesheet. When it comes time to work on my own styles I make new ones leaving the CSS Reset intact. Cascading Style Sheets work as a cascade from the top down which means with the CSS Reset on top the browser will first read all the reset styles and then whatever styles I define below and apply them in order. That way the layout is guaranteed to be clean of browser junk and only shows my style code.</p>
<p>That really is all there is to it. So employ the CSS Reset and go forth and code.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/tutorials/html-basics-hyperlink-syntax-absolute-relative-and-root-relative-20090824/' rel='bookmark' title='Permanent Link: HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative'>HTML Basics: Hyperlink Syntax &#8211; Absolute, Relative and Root-relative</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/center-a-page-horizontally-using-css-an-expansion-20080322/' rel='bookmark' title='Permanent Link: Center a Page Horizontally Using CSS &#8211; An Expansion'>Center a Page Horizontally Using CSS &#8211; An Expansion</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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/why-a-css-reset-should-be-at-the-core-of-your-stylesheet-20090817/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using WordPress in Alternate Configurations &#8211; My WordCamp Whistler 09 Presentation</title>
		<link>http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/</link>
		<comments>http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 15:30:48 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[template_tags]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordcamp]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=354</guid>
		<description><![CDATA[Finally, after a full week of catching up, here is the video tutorial version of my presentation at WordCamp Whistler 09 for those who were there and those who couldn&#8217;t come. The video is also available on WordPress.tv if you&#8217;d rather watch it there. I recorded the video over the weekend and it contains the [...]


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

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

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

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

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

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

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


<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/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>
<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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/video-tutorials/using-wordpress-in-alternate-configurations-my-wordcamp-whistler-09-presentation-20090203/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Code snippets from my WordCamp presentation</title>
		<link>http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/</link>
		<comments>http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 17:56:24 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[WordPress as CMS]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom page templates]]></category>
		<category><![CDATA[whistler]]></category>
		<category><![CDATA[wordcamp]]></category>
		<category><![CDATA[wordcamp whistler]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designisphilosophy.com/?p=332</guid>
		<description><![CDATA[Here are some code snippets from my WordCamp Whistler presentation. This article will be expanded in the coming week but in the meantime here they are for anyone wanting to play around with them: Custom Page Templates in 5 lines of code &#60;?php /* Template Name: Whatever */ ?&#62; Custom Fields in one line of [...]


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/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>
<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>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here are some code snippets from my WordCamp Whistler presentation. This article will be expanded in the coming week but in the meantime here they are for anyone wanting to play around with them:</p>
<h3>Custom Page Templates in 5 lines of code</h3>

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

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

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

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

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



<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/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>
<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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/tutorials/code-snippets-from-my-wordcamp-presentation-20090124/feed/</wfw:commentRss>
		<slash:comments>3</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>
		<item>
		<title>Highlight current page in WordPress menus</title>
		<link>http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/</link>
		<comments>http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 00:33:36 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=191</guid>
		<description><![CDATA[I have published an updated tutorial on this topic entitled Highlight Current Page or Category in WordPress 3.0 Menus. Click here to read the new article. WordPress has a lot of built in functionality that you can tap for advanced customization. One of these which is often ignored is the ability to highlight the current [...]


Related posts:<ol><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>
<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/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<blockquote><p>I have published an updated tutorial on this topic entitled <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Highlight Current Page or Category in WordPress 3.0 Menus</a>. <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Click here</a> to read the new article.</p></blockquote>
<p><img class="aligncenter size-full wp-image-194" title="Current Page Menu Item" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/11/currentpageitemmenu.jpg" alt="" width="500" height="42" />WordPress has a lot of built in functionality that you can tap for advanced customization. One of these which is often ignored is the ability to highlight the current page in menus with CSS. By default, WordPress assigns a special style class to the button that points to the current page. By styling this class differently from the &#8220;regular&#8221; classes the current page button is highlighted.</p>
<p>In this tutorial we&#8217;ll look at how to utilize the built in current page styling, how to create a menu like the one you see <a href="http://blog.pinkandyellow.com/tutorials/selectedTab/selectedTabDemo.html" title="Fancy menu example" target="_blank">above</a> and also how to hard code the functionality into a menu that is not generated dynamically by WordPress.</p>
<h4>Identifying the custom styles</h4>
<p>If you view the source code of a WordPress blog with a menu like the <a title="The reader's companion to my book" href="http://expression.pinkandyellow.com/" target="_blank">Reader’s Companion</a> you&#8217;ll see that the menu items have been given different classes automatically by the CMS:</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;menu&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item current_page_item&quot;</span>&gt;&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://expression.pinkandyellow.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;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-9&quot;</span>&gt;&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;Lesson Files&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/lesson-files/&quot;</span>&gt;</span>Lesson Files<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-11&quot;</span>&gt;&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 the Author&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/about-the-author/&quot;</span>&gt;</span>About the Author<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-13&quot;</span>&gt;&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;FAQ&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/faq/&quot;</span>&gt;</span>FAQ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-15&quot;</span>&gt;&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;Further Reading&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/further-reading/&quot;</span>&gt;</span>Further Reading<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-17&quot;</span>&gt;&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://expression.pinkandyellow.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;&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 important classes here are <em>page_item</em> which styles all the menu items and <em>current_page_item</em> which is only applied to the current page item. By styling these two classes independently you can get some very nice results. To demonstrate how far you can take this I&#8217;ve made a mock-up page that simulates the end output of a WordPress menu with custom styling. You can find it <a title="Current selected page tab demo" href="http://blog.pinkandyellow.com/tutorials/selectedTab/selectedTabDemo.html" target="_blank">here</a>.</p>
<p>By taking a closer look at the CSS you&#8217;ll see that the <em>page_item</em> and <em>current_page_item</em> classes have different styling. The remainder of the code is set up to make the button backgrounds expand and contract in accordance with the <a title="Sliding Door at AListApart.com" href="http://www.alistapart.com/articles/slidingdoors/" target="_blank">Sliding Doors technique from A List Apart</a>.The CSS code on the demo page is identical to the CSS code being used to style the page itself:</p>
<p><em>page_item</em> styles:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.page_item</span> a <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;img/right-over.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">15px</span> <span style="color: #933;">7px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#DDDDDD</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.page_item</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><em>current_page_item</em> styles:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.current_page_item</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;img/left-selected.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0 0 0 <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.current_page_item</span> a<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.current_page_item</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;img/right-selected.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">15px</span> <span style="color: #933;">7px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#C7532D</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>If you already have your menu up and running properly, all you need to do is style these two classes and you&#8217;ll automatically have the current page highlighted in your menu. But this only applies to dynamic menus generated by WordPress. What happens when you hard code your menus yourself?</p>
<h4>Assign dynamic styles to hard-coded menus</h4>
<p>To get the same effect when you create a hard-coded menu you need to apply some clever PHP code to each of your menu items.</p>
<p>If you don&#8217;t understand what I mean by &#8220;hard-coded menu&#8221; consider this: By default your menu is called by a function within WordPress that lists all of your pages plus the Home page. This call usually looks something like this:</p>

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

<p>But this function lists all your pages. If  you only want certain pages listed you have to take this function out and create a manual list yourself. This is a hard-coded menu.</p>
<p>To make the <em>current_page_item</em> class apply only to the current page item you need to add a small piece of PHP to each of your menu items. This line of code 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>is_page<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'home'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> echo <span style="color: #ff0000;">&quot;current_page_item&quot;</span>; <span style="color: #66cc66;">&#125;</span>?&gt;</span></pre></div></div>

<p>and is applied inside the <em>li</em> tag of each item. To give a concrete example I have added this code to the list items in the list example at the beginning of this tutorial:</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;menu&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item &lt;?php if (is_page('home')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<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://expression.pinkandyellow.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;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-9 &lt;?php if (is_page('Lesson Files')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<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;Lesson Files&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/lesson-files/&quot;</span>&gt;</span>Lesson Files<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-11 &lt;?php if (is_page('About the Author')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<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 the Author&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/about-the-author/&quot;</span>&gt;</span>About the Author<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-13 &lt;?php if (is_page('FAQ')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<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;FAQ&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/faq/&quot;</span>&gt;</span>FAQ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-15 &lt;?php if (is_page('Further Reading')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<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;Further Reading&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://expression.pinkandyellow.com/further-reading/&quot;</span>&gt;</span>Further Reading<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&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;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page_item page-item-17 &lt;?php if (is_page('Contact')) { echo &quot;</span>current_page_item<span style="color: #ff0000;">&quot;; }?&gt;</span></span>&quot;&gt;<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://expression.pinkandyellow.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;&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>When the page is loaded the PHP script looks to see if the page name matches the name in the <em>is_page</em> section and if it does, the <em>current_page_item</em> class is applied. Therefore the name you put in the <em>is_page</em> section of the PHP script must match the name of the page as created in WordPress exactly. If it does, the current page item will be highlighted dynamically.</p>
<blockquote><p>I have published an updated tutorial on this topic entitled <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Highlight Current Page or Category in WordPress 3.0 Menus</a>. <a href="http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category-20100809/" title="Highlight Current Page or Category in WordPress 3.0 Menus">Click here</a> to read the new article.</p></blockquote>


<p>Related posts:<ol><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>
<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/css/create-a-twitter-box-in-your-sidebar-20081106/' rel='bookmark' title='Permanent Link: Create a Twitter box in your sidebar'>Create a Twitter box in your sidebar</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/css/highlight-current-page-in-wordpress-menus-20081118/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Read my article in the Microsoft Expression November Newsletter</title>
		<link>http://www.designisphilosophy.com/microsoft-expression-web/read-my-article-in-the-microsoft-expression-november-newsletter-20081118/</link>
		<comments>http://www.designisphilosophy.com/microsoft-expression-web/read-my-article-in-the-microsoft-expression-november-newsletter-20081118/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:26:18 +0000</pubDate>
		<dc:creator>Morten Rand-Hendriksen</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Expression Web]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drop-down]]></category>
		<category><![CDATA[expression web]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.pinkandyellow.com/?p=186</guid>
		<description><![CDATA[A month or so ago Microsoft contacted me and asked if I would write an article on Expression Web for their Expression Newsletter. How could I say no to such an opportunity? After some back and forth about the topic I landed on an article on how to create a Pure CSS Drop-Down menu. Over [...]


Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/' rel='bookmark' title='Permanent Link: Pure CSS Drop-Down Menu tutorial &#8211; a slight omission'>Pure CSS Drop-Down Menu tutorial &#8211; a slight omission</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/how-expression-web-2-creates-css-20080624/' rel='bookmark' title='Permanent Link: How Expression Web 2 Creates CSS'>How Expression Web 2 Creates CSS</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>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://expression.microsoft.com/en-us/dd279540.aspx"><img class="alignleft" title="CSS Based Horizontal Drop-Down Menu" src="http://i.expression.microsoft.com/dd279538.css_menus_fp(en-us,MSDN.10).jpg" alt="" width="210" height="130" /></a>A month or so ago Microsoft contacted me and asked if I would write an article on Expression Web for their Expression Newsletter. How could I say no to such an opportunity? After some back and forth about the topic I landed on an article on <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">how to create a Pure CSS Drop-Down menu</a>. Over time I&#8217;ve encountered numerous solutions, most of which were clunky and didn&#8217;t work properly. So the tutorial demonstrates how to create a fully functional CSS-only drop-down menu utilizing the excellent CSS features in Expression Web.</p>
<p>That&#8217;s not to say you have to use Expression Web to get something out of the article though. You can follow the tutorial and get the same results even if you&#8217;re using Notepad to build your sites. It&#8217;s just that Expression Web makes it a hell of a lot easier to manage.</p>
<p><a href="http://tinyurl.com/styexpressionweb2"><img class="alignright" title="Sams Teach Yourself Microsoft Expression Web in 24 Hours" src="http://blog.pinkandyellow.com/wp-content/uploads/2008/06/styexpression.jpg" alt="" width="183" height="238" /></a>This article comes hot on the heels of my book <a title="Teach Yourself Expression Web 2 in 24 Hours" href="http://tinyurl.com/styexpressionweb2" target="_blank">Sams Teach Yourself Microsoft Expression Web 2 in 24 Hours</a> which contains an expanded tutorial on the same topic that also covers a layers-based drop-down menu. If you are an Expression Web 2 user of if you are considering buying or switching over to this excellent web authoring and publishing platform I humbly suggest you <a title="Get Teach Yourself Expression Web 2 in 24 Hours from Amazon.com" href="http://tinyurl.com/styexpressionweb2" target="_blank">pick up a copy for yourself</a>. It&#8217;s a quick read and it gives you hour-by-hour instructions on how to create a web site from scratch with the application. And once you&#8217;re done, you&#8217;ll have a fully working and standards based web site at your disposal. I wrote it as the book I wish someone had written when I started out and from the response I&#8217;ve gotten so far people are learning a lot from it. Which is what I set out to do.</p>
<p>If you&#8217;re interested in a preview of the kind of content you&#8217;ll find in the book or you just want to know <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">how to make a Pure CSS Drop-Down menu</a>, you can <a title="The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web" href="http://expression.microsoft.com/en-us/dd279540.aspx" target="_blank">read the full article, The No-Code Way to a Pure CSS Horizontal Drop-Down Menu with Expression Web, here</a> or <a title="Subscribe to the Expression Web Newsletter" href="https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=b62e5f03-3188-474a-a5f4-ff0116a3ccaa&amp;lcid=1033" target="_blank">subscribe to the Expression Web Newsletter</a>.</p>


<p>Related posts:<ol><li><a href='http://www.designisphilosophy.com/microsoft-expression-web/pure-css-drop-down-menu-tutorial-a-slight-omission-20081121/' rel='bookmark' title='Permanent Link: Pure CSS Drop-Down Menu tutorial &#8211; a slight omission'>Pure CSS Drop-Down Menu tutorial &#8211; a slight omission</a></li>
<li><a href='http://www.designisphilosophy.com/microsoft-expression-web/how-expression-web-2-creates-css-20080624/' rel='bookmark' title='Permanent Link: How Expression Web 2 Creates CSS'>How Expression Web 2 Creates CSS</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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.designisphilosophy.com/microsoft-expression-web/read-my-article-in-the-microsoft-expression-november-newsletter-20081118/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
