<?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>Digging into WordPress &#187; Design</title>
	<atom:link href="http://digwp.com/category/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://digwp.com</link>
	<description>Take your WordPress skills to the next level.</description>
	<lastBuildDate>Fri, 18 May 2012 18:21:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Don&#8217;t fork your theme, flex it with &#8220;is_plugin_active&#8221; conditional</title>
		<link>http://digwp.com/2012/04/dont-fork-your-theme-flex-it-with-is_plugin_active-conditional/</link>
		<comments>http://digwp.com/2012/04/dont-fork-your-theme-flex-it-with-is_plugin_active-conditional/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 17:49:08 +0000</pubDate>
		<dc:creator>Peter Shackelford</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[multisite]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=5847</guid>
		<description><![CDATA[Donkey Work Donkey work is really the last thing I want to be doing. Piddly tasks that could have been avoided with a little thought and perspective. Below I explain how I worked my way away from becoming a donkey with a dozen child themes to manage and maintain, with just a little knowledge of [...]]]></description>
			<content:encoded><![CDATA[<h3>Donkey Work</h3>
<p>Donkey work is really the last thing I want to be doing. Piddly tasks that could have been avoided with a little thought and perspective. Below I explain how I worked my way <em>away</em> from becoming a donkey with a dozen child themes to manage and maintain, with just a little knowledge of a native wordpress function.</p>
<p><span id="more-5847"></span></p>
<h3>The details.</h3>
<p>I am running a multisite that predominately uses a single child theme. Each site has it&#8217;s separate color scheme applied through a few lines of css. Where sites need unique functionality, <a href="http://wpcandy.com/teaches/how-to-create-a-functionality-plugin" title="functionality plugin" target="_blank">functionality plugins</a> are used. These contain custom post types, rss redirects, custom thumbnail sizes etc… This has worked really well for keeping our theme&#8217;s function.php file slim while giving us all the functionality we need, where we need it.</p>
<p>Each site uses a single identical footer, which is built into the theme. At the time, we did this knowing that we would be creating department sites as subdirectories. Content between the utility navigation and the footer was to be their turf but the utility nab and footer content are locked down. We built our universal footer using switch_to_blog function and a custom menu.</p>
<pre><code>&lt;?php
	global $blog_id;
		global $current_blog;
		switch_to_blog(25);
        	$args = array(
			'container'    =&gt; 'div',
			'menu'         =&gt; 'Footer',
			'container_id' =&gt; 'footer-links',
			'menu_class'   =&gt; 'menu', 
			'echo'         =&gt; true,
			'fallback_cb'  =&gt; 'wp_page_menu',
			'depth'        =&gt; 0
		);
		wp_nav_menu($args);
		restore_current_blog(); ?&gt;
		
&lt;div class="fix"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
jQuery(document).ready(function() {
	jQuery("ul#menu-footer.menu &gt; li &gt; a").contents().unwrap();
	jQuery('input[type=text]').focus(function() {
		jQuery(this).val('');
	});
});
&lt;/script&gt;</code></pre>
<p>The above code registers a new menu area called Footer. To take advantage of this I need to create a menu in the wordpress menu area with that exact name. The bit of JQuery turns off the link in the first level of menu items. This with a little css is used to create the menu headers. Great! One identical footer that is used on every site that uses this child theme. </p>
<h3>The Dilemma</h3>
<p>Recently we offered to host/manage websites for regional offices in our organization. They would benefit from our existing infrastructure and consistent branding but all of the content and navigation would be their own. They would not need our built in footer, at least not as it is on all the other sites.</p>
<p>I considered having a separate theme that was modified just for regional offices, I also considered building a plugin that disabled and replaced the footer on the existing theme. The first option would not be sustainable in the long run, the second very complicated at the outset. To be honest I very much doubt I could have pulled it off. My solution was to take advantage of the fact that I had already created a functionality plugin that would be used on every regional site. Using the <a href="http://codex.wordpress.org/Function_Reference/is_plugin_active" title="is_plugin_active">is_plugin_active</a> conditional I was able to alter the theme to not switch_to_blog if the regional plugin was enabled. </p>
<pre><code>if (is_plugin_active('regional-functionality-plugin.php')) {
	//plugin is activated! Look no switch_to_blog!!
	$args = array(
		'container'    =&gt; 'div',
		'menu'         =&gt; 'Footer',
		'container_id' =&gt; 'footer-links',
		'menu_class'   =&gt; 'menu', 
		'echo'         =&gt; true,
		'fallback_cb'  =&gt; 'wp_page_menu',
		'depth'        =&gt; 0
	);
	wp_nav_menu($args);
} else {
	global $blog_id;
	global $current_blog;
	switch_to_blog(45);
	$args = array(
		'container'    =&gt; 'div',
		'menu'         =&gt; 'Footer',
		'container_id' =&gt; 'footer-links',
		'menu_class'   =&gt; 'menu', 
		'echo'         =&gt; true,
		'fallback_cb'  =&gt; 'wp_page_menu',
		'depth'        =&gt; 0
	);
	wp_nav_menu($args);
	restore_current_blog();
} ?&gt;</code></pre>
<p>There we have it, 12 lines of code for the love of a single maintainable theme. So, if you want to earn your salt as a WordPress Developer, learn your <a href="http://codex.wordpress.org/Function_Reference/" title="WP Functions">functions</a> and save your energy for the creative work.</p>
<h3>About the Author</h3>
<p>Peter builds web platforms based on WordPress. In his off time he is expounding on the wonders of WordPress among family, friends and strangers. He and his brother host a monthly WordPress meetup in Jackson Michigan.</p>
<hr />
<p><small>© 2012 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2012/04/dont-fork-your-theme-flex-it-with-is_plugin_active-conditional/">Permalink</a> | <a href="http://digwp.com/2012/04/dont-fork-your-theme-flex-it-with-is_plugin_active-conditional/#comments">3 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2012/04/dont-fork-your-theme-flex-it-with-is_plugin_active-conditional/&title=Don&#8217;t fork your theme, flex it with &#8220;is_plugin_active&#8221; conditional">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/functions/" rel="tag">functions</a>, <a href="http://digwp.com/tag/multisite/" rel="tag">multisite</a>, <a href="http://digwp.com/tag/tips/" rel="tag">tips</a>, <a href="http://digwp.com/tag/tricks/" rel="tag">tricks</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2012/04/dont-fork-your-theme-flex-it-with-is_plugin_active-conditional/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML Formatting for Custom Menus</title>
		<link>http://digwp.com/2011/11/html-formatting-custom-menus/</link>
		<comments>http://digwp.com/2011/11/html-formatting-custom-menus/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 18:09:42 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=5440</guid>
		<description><![CDATA[For some projects, it&#8217;s nice to output clean, well-formatted markup. Using theme template files enables great control over most of your (X)HTML formatting, but not so much for automated functionality involving stuff like widgets and custom menus. One of my current projects requires clean, semantic HTML markup for all web pages, but also takes advantage [...]]]></description>
			<content:encoded><![CDATA[<p>For some projects, it&#8217;s nice to output clean, well-formatted markup. Using theme template files enables great control over most of your (X)HTML formatting, but not so much for automated functionality involving stuff like widgets and custom menus. One of my current projects requires clean, semantic HTML markup for all web pages, but also takes advantage of WordPress&#8217; custom-menu functionality to make things easy. In this <abbr title="Digging into WordPress">DiW</abbr> article, we&#8217;ll see how to enjoy both: WordPress custom menus <em>and</em> clean, well-formatted HTML markup.</p>
<p><span id="more-5440"></span></p>
<h3>Customizing HTML displayed with wp_nav_menu()</h3>
<p>By default, <a href="http://digwp.com/2010/08/using-menus-in-wordpress-3-0/" title="Using Menus in WordPress 3.0">WordPress custom menus</a> are displayed in your theme template using the <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">wp_nav_menu</a> function, which by default outputs markup that looks like this:</p>
<pre><code>&lt;div class="menu-test-container"&gt;&lt;ul id="menu-test" class="menu"&gt;&lt;li id="menu-item-6" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-6"&gt;&lt;a href="http://example.com/"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li id="menu-item-7" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-7"&gt;&lt;a href="http://example.com/demos/"&gt;Demos&lt;/a&gt;&lt;/li&gt;
&lt;li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8"&gt;&lt;a href="http://example.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/li&gt;
&lt;li id="menu-item-9" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9"&gt;&lt;a href="http://example.com/docs/"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</code></pre>
<p>That&#8217;s a <em>mess</em> of <code>class</code> and <code>id</code> attributes, plus an extra <code>&lt;div&gt;</code> container to boot. Fortunately, the <code>wp_nav_menu()</code> provides some useful parameters for customizing the display of your custom navigation menus. Here is a list of the <em>default parameters</em>:</p>
<pre><code>&lt;?php $defaults = array(
  'theme_location'  =&gt; ,
  'menu'            =&gt; , 
  'container'       =&gt; 'div', 
  'container_class' =&gt; 'menu-{menu slug}-container', 
  'container_id'    =&gt; ,
  'menu_class'      =&gt; 'menu', 
  'menu_id'         =&gt; ,
  'echo'            =&gt; true,
  'fallback_cb'     =&gt; 'wp_page_menu',
  'before'          =&gt; ,
  'after'           =&gt; ,
  'link_before'     =&gt; ,
  'link_after'      =&gt; ,
  'items_wrap'      =&gt; '&lt;ul id=\"%1$s\" class=\"%2$s\"&gt;%3$s&lt;/ul&gt;',
  'depth'           =&gt; 0,
  'walker'          =&gt; );
?&gt;</code></pre>
<p>Of these parameters, <code>$container</code> lets you specify how to wrap the <code>&lt;ul&gt;</code> element, using either <code>'div'</code>, <code>'nav'</code>, or <code>false</code>. So by specifying <code>false</code> for the <code>$container</code> parameter, we can simplify markup by removing the <code>&lt;div&gt;</code> container. The <code>wp_nav_menu</code> function also provides two more optional parameters for customizing menu markup:</p>
<ul>
<li><code>$items_wrap</code> &ndash; &#8220;Whatever to wrap the items with an ul, and how to wrap them with&#8221; (source: WP Codex)</li>
<li><code>$walker</code> &ndash; &#8220;Custom walker object to use (Note: You must pass an actual object to use, not a string)&#8221; (source: WP Codex)</li>
</ul>
<p>These <em>sound</em> useful, but I haven&#8217;t had much luck with either. The <code>$items_wrap</code> didn&#8217;t seem to do anything, but there are plenty of <a href="http://wordpress.stackexchange.com/questions/14037/menu-items-description/14039#14039">custom</a> <a href="http://erikshosting.com/wordpress-tips-code/building-a-wordpress-walker-creating-custom-dynamic-menu-outputs/">walker</a> <a href="http://benword.com/2011/how-to-hide-that-youre-using-wordpress/">scripts</a> available for further experimentation and customization. If you can get them to work properly, <strong>a custom walker provides complete control over custom-menu markup</strong> displayed with the <code>wp_nav_menu</code> tag. Unfortunately, I was unable to get very far with any of them, so I sought an alternate method..</p>
<h3>An alternative approach for custom markup</h3>
<p>After fiddling with a few of the various custom walkers, I decided to find an <em>easier way</em> to customize and format WordPress nav/menu markup. The walkers are fairly extensive and complex, and just seem like overkill for building a simple list of custom menu items. After some digging through the WordPress Codex, I found the <em>perfect</em> function for crafting squeaky-clean WordPress menus: <a href="http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items">wp_get_nav_menu_items</a>. As the name implies, <code>wp_get_nav_menu_items</code> returns the items from your custom navigation menus (as created in the WP Admin → Appearance → Menus panel). Thus, you can use this function to mark up your custom menus however you want. For my particular project, the desired format looks like this:</p>
<pre><code>&lt;nav&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href="http://example.com/"&gt;Home&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://example.com/demos/"&gt;Demos&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://example.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://example.com/docs/"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/nav&gt;</code></pre>
<p>Trying to do this with the commonly used <code>wp_nav_menu</code> function and a custom walker is possible, but it&#8217;s <em>much easier</em> building the menu structure from scratch, using only what&#8217;s required to make it happen. So alternately we use <code>wp_get_nav_menu_items</code> and begin with the <a href="http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items#Building_simple_menu_list">example function</a> provided at the Codex. After wrapping it in a <code>function</code> and customizing the output, we have the <code>clean_custom_menus()</code> function, ready for copy/paste into your theme&#8217;s <code>functions.php</code> file:</p>
<pre><code>// custom menu example @ http://digwp.com/2011/11/html-formatting-custom-menus/
function clean_custom_menus() {
	$menu_name = 'nav-primary'; // specify custom menu slug
	if (($locations = get_nav_menu_locations()) &amp;&amp; isset($locations[$menu_name])) {
		$menu = wp_get_nav_menu_object($locations[$menu_name]);
		$menu_items = wp_get_nav_menu_items($menu-&gt;term_id);

		$menu_list = '&lt;nav&gt;' ."\n";
		$menu_list .= "\t\t\t\t". '&lt;ul&gt;' ."\n";
		foreach ((array) $menu_items as $key =&gt; $menu_item) {
			$title = $menu_item-&gt;title;
			$url = $menu_item-&gt;url;
			$menu_list .= "\t\t\t\t\t". '&lt;li&gt;&lt;a href="'. $url .'"&gt;'. $title .'&lt;/a&gt;&lt;/li&gt;' ."\n";
		}
		$menu_list .= "\t\t\t\t". '&lt;/ul&gt;' ."\n";
		$menu_list .= "\t\t\t". '&lt;/nav&gt;' ."\n";
	} else {
		// $menu_list = '&lt;!-- no list defined --&gt;';
	}
	echo $menu_list;
}</code></pre>
<p>After placing in your <code>functions.php</code> file, you can call the function and display your custom menus anywhere in your theme by calling it directly:</p>
<p><code>&lt;?php if (function_exists(clean_custom_menus())) clean_custom_menus(); ?&gt;</code></p>
<p>Then, you can customize the <code>clean_custom_menus()</code> function as follows:</p>
<ol>
<li><strong>Line 3:</strong> specify your custom-menu slug</li>
<li><strong>Lines 8 thru 15:</strong> customize markup, tabs, and line breaks as needed</li>
<li><strong>Line 17:</strong> uncomment <code>else</code> condition and customize if needed</li>
</ol>
<p>For lines 8-15, anything is possible &ndash; you can include whatever list items, markup, and attributes required. Additionally, you can tab and indent markup to line up with page markup using <code>\n</code> for a new line and <code>\t</code> for a tab space. The fastest, easiest way to use this function is to copy/paste into your theme and then check out your list markup. For example, if the nav list is too far to the left, add some more tabs. You can also add <code>class</code> and <code>id</code> attributes, include custom items, and even manipulate which list items are displayed (<code>$url</code>, <code>$title</code>, etc.). After a little fine-tuning, <strong>the <code>wp_get_nav_menu_items()</code> function enables clean, well-formatted markup for your custom menus</strong>.</p>
<h3>Quick Summary</h3>
<p>In this article, we explain two ways to clean up and customize WordPress&#8217; custom-menu markup. Either of these methods will take your code from this:</p>
<pre><code>&lt;div class="menu-test-container"&gt;&lt;ul id="menu-test" class="menu"&gt;&lt;li id="menu-item-6" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-6"&gt;&lt;a href="http://example.com/"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li id="menu-item-7" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-7"&gt;&lt;a href="http://example.com/demos/"&gt;Demos&lt;/a&gt;&lt;/li&gt;
&lt;li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8"&gt;&lt;a href="http://example.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/li&gt;
&lt;li id="menu-item-9" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9"&gt;&lt;a href="http://example.com/docs/"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</code></pre>
<p>..to this:</p>
<pre><code>&lt;nav&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href="http://example.com/"&gt;Home&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://example.com/demos/"&gt;Demos&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://example.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://example.com/docs/"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/nav&gt;</code></pre>
<p>..or whatever HTML structure that&#8217;s required. You can achieve this with either of these methods:</p>
<ul>
<li>Combine <code>wp_nav_menu()</code> with a custom walker class</li>
<li>Combine <code>wp_get_nav_menu_items()</code> with the <code>clean_custom_menus()</code> function</li>
</ul>
<p>As usual, if you know of better ways of doing something, please share in the comments! Thanks for reading Digging into WordPress :)</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/11/html-formatting-custom-menus/">Permalink</a> | <a href="http://digwp.com/2011/11/html-formatting-custom-menus/#comments">43 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/11/html-formatting-custom-menus/&title=HTML Formatting for Custom Menus">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/functions/" rel="tag">functions</a>, <a href="http://digwp.com/tag/html/" rel="tag">HTML</a>, <a href="http://digwp.com/tag/menu/" rel="tag">menu</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/11/html-formatting-custom-menus/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>How to Redirect Logged-In Users</title>
		<link>http://digwp.com/2011/08/how-to-redirect-logged-in-users/</link>
		<comments>http://digwp.com/2011/08/how-to-redirect-logged-in-users/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 17:18:38 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=4731</guid>
		<description><![CDATA[WordPress provides a variety of ways to redirect logged-in users. In this DiW post, we explain each of these methods along with some useful tips and tricks along the way. These techniques enable you to redirect logged-in users to internal pages, external pages, and even return them to the current page. wp_redirect The wp_redirect function [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress provides a variety of ways to redirect logged-in users. In this <abbr title="Digging into WordPress">DiW</abbr> post, we explain each of these methods along with some useful tips and tricks along the way. These techniques enable you to redirect logged-in users to internal pages, external pages, and even return them to the current page.</p>
<p><span id="more-4731"></span></p>
<h3>wp_redirect</h3>
<p>The <a href="http://codex.wordpress.org/Function_Reference/wp_redirect" title="Function Reference/wp redirect">wp_redirect</a> function is for redirecting <em>all users</em> to any absolute <abbr title="Uniform Resource Identifier">URI</abbr>. Absolute URIs are basically <em>full</em> <abbr title="Uniform Resource Locator">URL</abbr>s and look like this:</p>
<ul>
<li><code>http://digwp.com/book/</code></li>
<li><code>http://digwp.com/wp-content/blog-images/redirecting-users.jpg</code></li>
<li><code>ftp://example.com/transfer/</code></li>
</ul>
<p>To redirect users with <code>wp_redirect</code>, place the following <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> snippet in your theme file:</p>
<pre><code>&lt;?php wp_redirect('http://example.com/'); exit; ?&gt;</code></pre>
<p>The parameters for <code>wp_redirect</code> are <em>two</em> in number:</p>
<ul>
<li><strong>$location</strong> = The absolute URI to which the user will be redirected. No default.</li>
<li><strong>$status</strong> = The status code to use. For example, <code>301</code>, <code>302</code>, etc. The default is <code>302</code>.</li>
</ul>
<p>You can use template tags for the <code>$location</code> parameter, for example:</p>
<pre><code>&lt;?php // redirect to the home page
wp_redirect(home_url()); exit; ?&gt;

&lt;?php // redirect back to current page
wp_redirect(get_permalink()); exit; ?&gt;</code></pre>
<p>To use a status code other than the default <code>302</code>, specify it like so:</p>
<pre><code>&lt;?php wp_redirect('http://example.com/', 301); exit; ?&gt;</code></pre>
<p>That code will send the user to <code>example.com</code> along with status code <code>301</code> (Moved Permanently). The default <code>302</code> should be used for <em>temporary</em> redirects. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" title="10 Status Code Definitions">Learn more about status codes</a>.</p>
<h3 id="auth_redirect">auth_redirect</h3>
<p>Next up, we have <a href="http://codex.wordpress.org/Function_Reference/auth_redirect" title="Function Reference/auth redirect">auth_redirect</a>, which is a &#8220;simple function that requires that the user be logged in before they can access a page.&#8221; So for example, let&#8217;s say you have a &#8220;downloads&#8221; page that&#8217;s meant for logged-in users only. To prevent unauthorized access, we would add the following code to the top of the downloads page template:</p>
<pre><code>&lt;?php auth_redirect(); ?&gt;</code></pre>
<p>This extremely useful function checks whether or not the current user is logged in, and redirects them to the <strong>Login Page</strong> if not. By default, the user will be redirected back to the page from whence they came (e.g., the downloads page). Currently this function accepts no parameters, but having something like <strong>$location</strong> would make it even more awesome&nbsp;;)</p>
<h3>wp_logout_url</h3>
<p>The <a href="http://codex.wordpress.org/Function_Reference/wp_logout_url" title="Function Reference/wp logout url">wp_logout_url</a> function <em>returns</em> the URL of your site&#8217;s <strong>Logout Page</strong>. But it can also redirect the user to any URL using the <code>$redirect</code> parameter, like so:</p>
<pre><code>&lt;?php echo wp_logout_url($redirect); ?&gt;</code></pre>
<p><code>$redirect</code> parameter is a string containing the redirect URL. Here are some examples:</p>
<pre><code>&lt;!-- Logout &amp; redirect to the home page --&gt;
&lt;a href="&lt;?php echo wp_logout_url(home_url()); ?&gt;"&gt;Logout&lt;/a&gt;

&lt;!-- Logout &amp; redirect to current page --&gt;
&lt;a href="&lt;?php echo wp_logout_url(get_permalink()); ?&gt;"&gt;Logout&lt;/a&gt;

&lt;!-- Logout &amp; redirect to specific URL --&gt;
&lt;a href="&lt;?php echo wp_logout_url('http://example.com/'); ?&gt;"&gt;Logout&lt;/a&gt;</code></pre>
<p>The automatic logout link is great, but the subsequent redirect is a super-useful tool that we use in our <a href="http://digwp.com/2010/12/login-register-password-code/" title="Custom Login/Register/Password Code">custom login/register tutorial</a>.</p>
<h3>is_user_logged_in</h3>
<p>Lastly we have the <a href="http://codex.wordpress.org/Function_Reference/is_user_logged_in" title="Function Reference/is user logged in">is_user_logged_in</a> function, which technically doesn&#8217;t do any redirecting, but enables you to <strong>check if the user is logged in</strong>. Here is a simple example that should work in any theme template file:</p>
<pre><code>&lt;?php if (is_user_logged_in()) { echo "logged in"; } else { echo "not logged in" } ?&gt;</code></pre>
<p>The <code>is_user_logged_in</code> function returns <code>TRUE</code> or <code>FALSE</code>, depending on the user&#8217;s status. So to display custom content to logged in users, you could do something like this:</p>
<pre><code>&lt;?php if (is_user_logged_in()) { ?&gt;

	&lt;p&gt;Welcome, registered user!&lt;/p&gt;

&lt;?php } else { // not logged in ?&gt;

	&lt;p&gt;Welcome, visitor!&lt;/p&gt;

&lt;?php } ?&gt;</code></pre>
<p>And you can mix-n-match <code>is_user_logged_in</code> with other template tags and PHP snippets to return more refined results. For example, we can serve custom content based on logged status <em>and</em> location:</p>
<pre><code>&lt;?php if (is_user_logged_in()) {

	if (is_page()) {
		echo "Logged-in user visiting a page";

	} elseif (is_feed()) {
		echo "Logged-in user viewing a feed";

	} elseif (is_search()) {
		echo "Logged-in user doing a search";

	} else {
		echo "Logged-in user doing something else";
	}

} else { // user is not logged-in

	if (is_page()) {
		echo "Normal visitor on a page";

	} elseif (is_feed()) {
		echo "Normal visitor viewing a feed";

	} elseif (is_search()) {
		echo "Normal visitor doing a search";

	} else {
		echo "Normal visitor doing something else";
	}

} ?&gt;</code></pre>
<p>This example demonstrates the flexibility of WordPress conditional tags and how <code>is_user_logged_in</code> throws another layer of control to the mix.</p>
<h3>Note about auth_redirect and is_user_logged_in</h3>
<p>As <a href="http://wordpress.org/support/topic/auth_redirect" title="Support Topic: auth_redirect">discussed here</a>, <code>auth_redirect</code> currently seems to be acting kinda weird, where the post-login redirect isn&#8217;t working. Instead of returning the user to the current page after login, the user always ends up back at the Login Page. It <em>looks</em> like the <code>auth_redirect</code> function isn&#8217;t recognizing the new &#8220;logged-in&#8221; user status, and so it just keeps sending the user back to <code>login.php</code>.</p>
<p>So until this is fixed, there is a simple workaround which involves <em>combining</em> <code>auth_redirect</code> with <code>is_user_logged_in</code> to do <a href="#auth_redirect">what auth_redirect <em>should</em> be doing</a>. All that&#8217;s required is the following snippet of code placed at the top of your theme template:</p>
<pre><code>&lt;?php if (!is_user_logged_in()) { auth_redirect(); } ?&gt;</code></pre>
<p>With this technique, <code>auth_redirect</code> executes only if the user is NOT logged in. So yeah it&#8217;s a hack, but it works great and should continue working if/when <code>auth_redirect</code> is fixed.</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/08/how-to-redirect-logged-in-users/">Permalink</a> | <a href="http://digwp.com/2011/08/how-to-redirect-logged-in-users/#comments">9 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/08/how-to-redirect-logged-in-users/&title=How to Redirect Logged-In Users">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/admin/" rel="tag">Admin</a>, <a href="http://digwp.com/tag/redirects/" rel="tag">redirects</a>, <a href="http://digwp.com/tag/users/" rel="tag">users</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/08/how-to-redirect-logged-in-users/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Tumblr Links with Post Formats</title>
		<link>http://digwp.com/2011/04/tumblr-links-post-formats/</link>
		<comments>http://digwp.com/2011/04/tumblr-links-post-formats/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 17:49:20 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[post-formats]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=3865</guid>
		<description><![CDATA[With WordPress 3.1&#8217;s new Post Format functionality, it&#8217;s easier than ever to create your own Tumblr-style Link posts. We do this right here at DigWP.com using our own hand-rolled method. Scroll through a page or two of the site&#8217;s most recent posts, and you&#8217;ll see that Link posts are formatted and styled differently than regular [...]]]></description>
			<content:encoded><![CDATA[<p>With WordPress 3.1&rsquo;s new <strong>Post Format</strong> functionality, it&rsquo;s easier than ever to create your own <strong>Tumblr-style Link posts</strong>. We do this right here at <a href="http://digwp.com/">DigWP.com</a> using our own <a href="http://digwp.com/2009/09/tumblr-style-links-for-posts-and-feeds/" title="How to Implement Tumblr-Style Links for Posts and Feeds">hand-rolled method</a>. Scroll through a page or two of the site&rsquo;s most recent posts, and you&rsquo;ll see that <strong>Link posts</strong> are formatted and styled differently than regular posts (see screenshot below). In this tutorial, you&#8217;ll learn how to use <strong>WordPress&#8217; new Post Formats</strong> to setup your own <strong>Tumblr-style Links</strong> in <em>3 easy steps</em>.</p>
<p><span id="more-3865"></span></p>
<p><img src="http://digwp.com/wp-content/blog-images/post-formats-digwp-links.gif" alt="[ Screenshot: Link Posts at DigWP.com ]" /></p>
<p>Link posts are meant for quick links to <em>external</em> resources. Ideally, they&#8217;re styled for easy recognition without breaking the flow of post content. Link posts look like link posts, Asides look like asides, Galleries look like galleries, and so on. Here&#8217;s a chart showing the differences between <em>regular posts</em> and <em>Link posts</em>:</p>
<p><img src="http://digwp.com/wp-content/blog-images/post-formats-compare.gif" alt="[ Regular vs Link Posts ]" /></p>
<p>Notice the <strong>key difference</strong> between the two types of posts: <strong>regular post titles</strong> link to the <em>single-view</em> of the post, but <strong>Link post titles</strong> link to the <abbr title="Uniform Resource Locator">URL</abbr> of an <em>external resource</em> (i.e., whatever awesome thing you&#8217;re sharing with your visitors). This makes it super-easy to share links via <em>true</em> &#8220;Tumblr-style&#8221; Link posts. And with WordPress 3.1&rsquo;s new <strong>Post Formats</strong> functionality, it&#8217;s <em>easier than ever</em> to do.</p>
<h3>Easy, 3-Step Tutorial</h3>
<p>Here&#8217;s an overview of the tutorial:</p>
<ol>
<li><a href="#step1">Enable Post Formats via <code>functions.php</code></a></li>
<li><a href="#step2">Include the conditional template tags in your theme files</a></li>
<li><a href="#step3">Style with some <abbr title="Cascading Style Sheets">CSS</abbr> via <code>style.css</code> (optional)</a></li>
<li><a href="#usage">Usage and notes</a></li>
</ol>
<p>Even if you don&#8217;t implement this technique, the tutorial provides a great example of how Post Formats can be used to add variety and depth to any WordPress-powered site.</p>
<h3 id="step1">Step 1: Enable Post Formats</h3>
<p>First, make sure you have the latest version of WordPress (3.1 or better), and then <strong>enable Post Formats</strong> by adding this snippet to your theme&#8217;s <code>functions.php</code> file:</p>
<pre><code>// Enable Post Formats for WP 3.1+
add_theme_support('post-formats',array('aside','chat','gallery','image','link','quote','status','video','audio'));</code></pre>
<p>With that in place, all nine (+1 default) Post Formats will be enabled on your site. Next time you write or edit a post, you should see a <strong>Post Formats</strong> panel with options for each of these different formats. If you know you won&#8217;t be needing some of them, feel free to edit the parameter list in the code snippet. Otherwise, it&#8217;s totally fine to leave them all enabled &ndash; it doesn&#8217;t hurt anything &ndash; it&#8217;s just a matter of preference.</p>
<h3 id="step2">Step 2: Customize your theme files</h3>
<p>Next, in your theme&#8217;s template file(s), replace the markup/tags used to generate your post titles (located in the loop) with the following conditional code: </p>
<pre><code>&lt;?php if (has_post_format('link') &amp;&amp; get_post_meta($post-&gt;ID, 'LinkFormatURL', true)) : ?&gt;
			
	&lt;h2&gt;&lt;a href="&lt;?php echo get_post_meta($post-&gt;ID, 'LinkFormatURL', true); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
			
&lt;?php else : ?&gt;
			
	&lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
			
&lt;?php endif; ?&gt;</code></pre>
<p>The first line tests each post using <code>has_post_format</code> and <code>get_post_meta</code>. IF the post is a <strong>Link post</strong> (has &#8220;<code>link</code>&#8221; post format) AND has an alternate URL (via &#8220;<code>LinkFormatURL</code>&#8221; custom field), the post title will be Tumblr-style <em>as specified</em> in the second line of code. If <em>both</em> of those conditions <em>fail</em>, the post title will be the regular/default, as specified in the fourth line of code. You may use any <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>/markup needed to customize your Link posts to suit your design.</p>
<p><strong id="step2update">Update:</strong> <a href="http://digwp.com/2011/04/tumblr-links-post-formats/#comment-20779" title="Read comment">Matt Wiebe</a> makes this step even easier. Instead of messing with your theme files, just add this snippet to your theme&#8217;s <code>functions.php</code>:</p>
<pre><code>// filter post title for tumblr links
function sd_link_filter($link, $post) {
     if (has_post_format('link', $post) &amp;&amp; get_post_meta($post-&gt;ID, 'LinkFormatURL', true)) {
          $link = get_post_meta($post-&gt;ID, 'LinkFormatURL', true);
     }
     return $link;
}
add_filter('post_link', 'sd_link_filter', 10, 2);</code></pre>
<p>This script filters the <code>post_link</code> and returns the correct URL based on the same conditions as before. Just plug-n-play &ndash; no other theme modifications required. Thanks to <a href="http://somadesign.ca/">Matt Wiebe</a> for sharing this more elegant method.</p>
<h3 id="step3">Step 3: Style with CSS</h3>
<p>Lastly and optionally, you are encouraged to customize the appearance of your custom Post Formats. Referring back to the opening screenshot, notice how Link posts stand out as distinct and easy to recognize as such. To style your Link posts with CSS, make sure your theme includes the <code>post_class()</code> tag in the outer <code>&lt;div&gt;</code> (or whatever) for each post. The <code>post_class()</code> function will then output the Post-Format name as a class attribute for each post. This provides a nice hook for hanging your custom CSS. Here is a simple example using our code from Step 2:</p>
<pre><code>.format-standard { width: 100%; }
.format-link     { width: 75%; }

.format-standard h2 { font-size: 24px; }
.format-link h2     { font-size: 16px; }

.format-standard a { color: #000; }
.format-link a     { color: #777; }</code></pre>
<p>Using the <code>.format-{whatever}</code> class attribute, it&#8217;s easy to style each of your Post Formats with a distinct appearance that&#8217;s easy to recognize.</p>
<h3 id="usage">Usage and Notes</h3>
<p>Once you get everything setup, posting Links is as easy as 1-2-3..</p>
<ol>
<li><strong>Write</strong> your Link post</li>
<li><strong>Choose</strong> the &#8220;Link&#8221; format type from the Format radio-button menu (located under the Publish panel)</li>
<li><strong>Add</strong> the Link URL (external resource) to a custom field named &#8220;<code>LinkFormatURL</code>&#8221; (see screenshot below)</li>
</ol>
<p><img src="http://digwp.com/wp-content/blog-images/post-formats-custom-field.gif" alt="[ Screenshot: Link Post Custom Field ]" /></p>
<p>And that&#8217;s all there is to it! After posting a new Link, it will be displayed using the format and styles that you&#8217;ve applied. A few notes:</p>
<ol>
<li>CSS hooks for post-formats are available via <code>post_class()</code></li>
<li>When customizing your theme as per Step 2, don&#8217;t forget about <code>archive.php</code>, <code>category.php</code>, and any other template files that use the loop</li>
<li>This tutorial sets up Tumblr-style Links for your blog only, but you can <a href="http://digwp.com/2009/09/tumblr-style-links-for-posts-and-feeds/" title="How to Implement Tumblr-Style Links for Posts and Feeds">check this post</a> to setup the Tumblr Links for feeds as well</li>
</ol>
<p>If you have any questions about setting this up on your site, leave a comment and we&#8217;ll try to help. Also, see the &#8220;Possibly Related Posts&#8221; below for related content on this topic.</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/04/tumblr-links-post-formats/">Permalink</a> | <a href="http://digwp.com/2011/04/tumblr-links-post-formats/#comments">16 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/04/tumblr-links-post-formats/&title=Tumblr Links with Post Formats">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/functions/" rel="tag">functions</a>, <a href="http://digwp.com/tag/post-formats/" rel="tag">post-formats</a>, <a href="http://digwp.com/tag/theme/" rel="tag">Theme</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/04/tumblr-links-post-formats/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>List of WordPress Developers &amp; Designers</title>
		<link>http://digwp.com/2011/01/list-of-wordpress-developers-designers/</link>
		<comments>http://digwp.com/2011/01/list-of-wordpress-developers-designers/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 17:33:39 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=3608</guid>
		<description><![CDATA[Looking for WordPress developers and designers? So are many people. Time is scarce these days, and we get quite a few folks asking about where to go for help with their WordPress site. Most of the WP peeps that we know are just as busy as we are, so it would be helpful to have [...]]]></description>
			<content:encoded><![CDATA[<p>Looking for WordPress developers and designers? So are many people. Time is scarce these days, and we get quite a few folks asking about where to go for help with their WordPress site. Most of the <abbr title="WordPress">WP</abbr> peeps that we know are just as busy as we are, so it would be helpful to have a nice, healthy list of <strong>WordPress designers and developers</strong> all in one place that people could check out and find some good candidates.</p>
<p><span id="more-3608"></span></p>
<p>So, if you&rsquo;re a WordPress professional, available for hire, and would like to be included in our list of designers &amp; developers, just leave a comment with a quick summary of <strong>how you can help clients with WordPress</strong>. Include as much or as little information as you would like, but please don&rsquo;t get carried away with an entire resume or anything. Some essential things to include:</p>
<ul>
<li>Name / Business Name</li>
<li>Contact Information (Twitter, Facebook, Skype, whatever)</li>
<li><strong>What you do</strong></li>
<li>Relevant experience</li>
<li>Link to portfolio or company page</li>
</ul>
<p><em>Why</em> do this? Because it will be great to have a resource for our WordPress-hungry visitors to check out. We&rsquo;ve got an amazing readership &amp; audience here at DigWP.com, and plenty of traffic, so hopefully this <abbr title="Digging into WordPress">DiW</abbr> List of WordPress Designers &amp; Developers will reach many people and help everyone find exactly what/who they are looking for. It&rsquo;s a win-win-win!&nbsp;:)</p>
<p>Thanks for your help!</p>
<hr />
<p><small>© 2011 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2011/01/list-of-wordpress-developers-designers/">Permalink</a> | <a href="http://digwp.com/2011/01/list-of-wordpress-developers-designers/#comments">185 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2011/01/list-of-wordpress-developers-designers/&title=List of WordPress Developers &amp; Designers">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/list/" rel="tag">list</a>, <a href="http://digwp.com/tag/reference/" rel="tag">reference</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2011/01/list-of-wordpress-developers-designers/feed/</wfw:commentRss>
		<slash:comments>185</slash:comments>
		</item>
		<item>
		<title>Custom Message After the Comments</title>
		<link>http://digwp.com/2010/12/custom-message-after-comments/</link>
		<comments>http://digwp.com/2010/12/custom-message-after-comments/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 18:14:27 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[message]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=3377</guid>
		<description><![CDATA[Have you ever wanted to close a comment thread, but leave a note to communicate why the thread is closed? Many blogs will just update the content of the blog post to say that comments are closed and why. That&#8217;s better than nothing, but that puts the message in a bit of an awkward place. [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to close a comment thread, but leave a note to communicate why the thread is closed? Many blogs will just update the content of the blog post to say that comments are closed and why. That&#8217;s better than nothing, but that puts the message in a bit of an awkward place. The ideal place for that custom messaging is <em>after</em> the comment thread, where the comment form would <em>normally</em> be.</p>
<p><span id="more-3377"></span></p>
<p>One example situation is the contest we just ran. Like many blog-based comments, it was comment-to-win. That means it&#8217;s best to close the comments when the contest is over, so people clearly understand that it&#8217;s over. We do close comments after a few months on this site to avoid spam and questions that come in way after the fact and will probably never be answered, but this is a case where we close comments much sooner than a few months. When we closed the contest, we actually put the winners of it as a custom message beneath the comment thread. </p>
<div class="image-wrap">
<img src="http://digwp.com/wp-content/uploads/custommessage.png" alt="" title="custommessage" width="590" height="260" class="alignnone size-full wp-image-3469" />
</div>
<p>To accomplish this in a very easy-to-use manner, we&#8217;ll create a custom meta box inside the Post Editor itself.</p>
<p><!--more--></p>
<h3>Functions.php</h3>
<p>We need to hook into two actions for this. We&#8217;ll use the &#8216;admin_menu&#8217; and &#8216;add_meta_box&#8217; to create the meta box. Then we&#8217;ll tap into &#8216;save_post&#8217; and use &#8216;update_post_meta&#8217; to actually save the value entered.</p>
<pre><code>// After Comments Message

add_action('admin_menu', 'custom_comments_message_hooks');
add_action('save_post', 'save_custom_comments_message');

function custom_comments_message_hooks() {
	add_meta_box('custom_comments_message', 'Custom Comments Message', 'custom_comments_message_input', 'post', 'normal', 'high');
}
function custom_comments_message_input() {
	global $post;
	echo '
&lt;input id="custom_comments_message_noncename" name="custom_comments_message_noncename" type="hidden" value="'.wp_create_nonce('custom_comments_message').'" /&gt;';
	echo '&lt;textarea id="custom_comments_message" style="width: 100%;" cols="30" rows="5" name="custom_comments_message"&gt;'.get_post_meta($post-&amp;gt;ID,'_custom_comments_message',true).'&lt;/textarea&gt;';
}
function save_custom_comments_message($post_id) {
	if (!wp_verify_nonce($_POST['custom_comments_message_noncename'], 'custom_comments_message')) return $post_id;
	if (defined('DOING_AUTOSAVE') &amp;amp;&amp;amp; DOING_AUTOSAVE) return $post_id;
	$custom_comments_message = $_POST['custom_comments_message'];
	update_post_meta($post_id, '_custom_comments_message', $custom_comments_message);
}</code></pre>
<p>That is the entire UI for creating this functional data-saving meta box. Now we just need to actually use that value.</p>
<h3>Comments.php</h3>
<p>There is some logic in the comments.php file which tests if comments are open or not. If they are, the comment form is output, if they are not, some kind of &#8220;comments closed&#8221; message is output. We&#8217;ll be tinkering around in the &#8220;if they are not&#8221; section (the &#8220;else&#8221; code below) and adding a check for our special custom field value. If it&#8217;s present, output that, if not, output the default.</p>
<pre><code>&lt;?php if ( comments_open() ) :

  // regular outputting of comments stuff in here

&lt;?php else: 

	global $post;

	$custom_message = get_post_meta($post-&gt;ID, '_custom_comments_message', true);
		
	if ($custom_message != '') {
		
		echo '&lt;div id="after-comments-message"&gt;';
		echo $custom_message;
		echo "&lt;/div&gt;";
		
	} else {
	
		echo '&lt;div id="after-comments-message"&gt;Comments are closed. If you have something really important to add, &lt;a href="/contact/"&gt;contact us&lt;/a&gt;. Thank you!&lt;/div&gt;';
	
	} ?&gt;
	
&lt;?php endif; ?&gt;</code></pre>
<p>That&#8217;s all there is to it! Now you have a fancy custom box right in your Post Editor where, should you choose, you can close comments and write a custom message to display after the existing comments. </p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/12/custom-message-after-comments/">Permalink</a> | <a href="http://digwp.com/2010/12/custom-message-after-comments/#comments">15 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2010/12/custom-message-after-comments/&title=Custom Message After the Comments">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/comments/" rel="tag">comments</a>, <a href="http://digwp.com/tag/functions-php/" rel="tag">functions.php</a>, <a href="http://digwp.com/tag/message/" rel="tag">message</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/12/custom-message-after-comments/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Randomized Grid of Posts</title>
		<link>http://digwp.com/2010/08/randomized-grid-of-posts/</link>
		<comments>http://digwp.com/2010/08/randomized-grid-of-posts/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 15:31:11 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[archives]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2673</guid>
		<description><![CDATA[I&#8217;m all about tinkering with different ideas to display posts with WordPress. After all, it&#8217;s just a bunch of data at our fingertips! WordPress makes it easy to output whatever we need. Not long ago we experimented with making a Thumbnail Based Archives. Now let&#8217;s build a Randomized Grid Archives. 1. Create a page template, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m all about tinkering with different ideas to display posts with WordPress. After all, it&#8217;s just a bunch of data at our fingertips! WordPress makes it easy to output whatever we need. Not long ago we experimented with making a <a href="http://digwp.com/2010/07/thumbnail-based-archives/">Thumbnail Based Archives</a>. Now let&#8217;s build a <a href="http://digwp.com/archives/grid/">Randomized Grid Archives</a>.</p>
<p><img src="http://digwp.com/wp-content/uploads/gridexample.jpg" alt="" title="gridexample" width="590" height="337" class="alignnone size-full wp-image-2668" /></p>
<p><span id="more-2673"></span></p>
<h3>1. Create a page template, publish a page</h3>
<p>We need a totally unique page template to work with. So create a new one. You know, just make a file like grid-archives.php in your theme and put this PHP comment at the top and then WordPress will recognize it. Then create a new page, pick this template, and publish it. The name and content absolutely don&#8217;t matter, just put something there so you can recognize/find it later.</p>
<pre><code>&lt;?php
/*
Template Name: Thumb Archives - Grid
*/
?&gt;</code></pre>
<h3>2. Loop it</h3>
<p>This is pretty much the entire page. We&#8217;ll link out to an external stylesheet for styling. Then we run a Loop for 25 posts (in our demo, we also remove our link style posts). Each post is an anchor tag, and within, the post title, the post image thumbnail, and the excerpt.</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
	&lt;meta charset="UTF-8" /&gt;
	&lt;title&gt;Grid Archives | Digging Into WordPress&lt;/title&gt;
	&lt;link rel="stylesheet" type="text/css" media="all" href="&lt;?php bloginfo("template_url"); ?&gt;/css/gridarchives.css" /&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;div id="page-wrap"&gt;
		&lt;?php query_posts('posts_per_page=25&amp;cat=-52'); ?&gt;
		&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
			&lt;a href="&lt;?php the_permalink(); ?&gt;" class="box col&lt;?php echo rand(2,4); ?&gt;"&gt;
				&lt;span class="title"&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;
				&lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, 'PostThumb', true); ?&gt;" alt="" /&gt;
				&lt;span class="ex"&gt;&lt;?php the_excerpt(); ?&gt;&lt;/span&gt;
			&lt;/a&gt;
		&lt;?php endwhile; endif; ?&gt;
	&lt;/div&gt;
&lt;/body&gt;
	
&lt;/html&gt;</code></pre>
<h3>3. Masonize</h3>
<p>Notice in the HTML above we echo&#8217;d out a random number between 2 and 4 as part of a class name. The results classes will be: col-2, col-3, and col-4. These represent columns. So each link box is &#8220;randomized&#8221; based on this class name. Some post link boxes are 2 columns wide, others 3, others 4. Font sizing and thumbnail sizing also adjusts accordingly.</p>
<pre><code>.box { margin: 10px; float: left; }
.box:hover { outline: 2px solid white; }
.box:hover .title { background: none; }
.box:hover .ex { background: none; color: white; }
.box:hover img { opacity: 0.4; }

.col2 { width: 180px; }
.col3 { width: 280px; }
.col4 { width: 380px; }

.col2 img { max-width: 80px; float: right; margin: 0 0 2px 10px; }
.col3 img { max-width: 100px; float: left; margin: 0 10px 2px 0; }
.col4 img { max-width: 120px; float: right; margin: 0 0 2px 10px; }

.title { background: #237abe; color: white; display: block; padding: 10px; overflow: hidden; }
.col2 .title { font-size: 16px; }
.col3 .title { font-size: 18px; }
.col4 .title { font-size: 20px; }

.ex { background: white; color: #222; display: block; padding: 10px; }
.col2 .ex { font-size: 11px; }
.col3 .ex { font-size: 12px; }
.col4 .ex { font-size: 13px; }</code></pre>
<p>So each of those post link boxes is just floated to the left. That&#8217;s going to make a pretty ragged and nasty layout all by itself, because each box will be a different height depending on the length of the title and excerpt. No problem though, we&#8217;re going to rearrange the boxes using the <a href="http://desandro.com/resources/jquery-masonry/">jQuery Masonry plugin</a> by David DeSandro. We&#8217;ll just call jQuery, the plugin, and the write a quick script to call it. This can go pretty much anywhere on the page. Typically jQuery is run on DOM ready, but in this case we are waiting for the window&#8217;s load event, because we want to wait for the thumbnails to load before masonizing.</p>
<pre><code>&lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'&gt;&lt;/script&gt;
&lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/jquery.masonry.min.js'&gt;&lt;/script&gt;
&lt;script&gt;
 $(window).load(function() {
   $("#page-wrap").masonry({
      columnWidth: 100, 
      animate: true, 
      animationOptions: {
          duration: 300,
          queue: false
      }
  });
 });
&lt;/script&gt;</code></pre>
<h3>Enjoy!</h3>
<p><a href="http://digwp.com/archives/grid/">Here is ours.</a> Let us know if you play with this on your own site at all.</p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/08/randomized-grid-of-posts/">Permalink</a> | <a href="http://digwp.com/2010/08/randomized-grid-of-posts/#comments">17 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2010/08/randomized-grid-of-posts/&title=Randomized Grid of Posts">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/archives/" rel="tag">archives</a>, <a href="http://digwp.com/tag/grid/" rel="tag">grid</a>, <a href="http://digwp.com/tag/jquery/" rel="tag">jquery</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/randomized-grid-of-posts/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Using Menus in WordPress 3.0</title>
		<link>http://digwp.com/2010/08/using-menus-in-wordpress-3-0/</link>
		<comments>http://digwp.com/2010/08/using-menus-in-wordpress-3-0/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 15:12:37 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2637</guid>
		<description><![CDATA[The menu system in WordPress 3.0 was hotly anticipated. But perhaps unbeknownst to many average WordPress users, actually using this feature takes some coding work. In fact, even enabling the features take a bit of code. Below we&#8217;ll go through the steps for inserting a custom menu into your theme. Note that many themes will [...]]]></description>
			<content:encoded><![CDATA[<p>The menu system in WordPress 3.0 was hotly anticipated. But perhaps unbeknownst to many average WordPress users, actually using this feature takes some coding work. In fact, even enabling the features take a bit of code.</p>
<div class="image-wrap">
<img src="http://digwp.com/wp-content/uploads/wpmenusnoactive.png" alt="" title="wpmenusnoactive" width="450" height="143" class="size-full wp-image-2638" />
</div>
<p>Below we&#8217;ll go through the steps for inserting a custom menu into your theme. Note that many themes will have menu functionality built-in. This is for Do-It-Yourself folks who are trying to add it to their existing theme.</p>
<p><span id="more-2637"></span></p>
<h3>1. Register menus in functions.php file</h3>
<pre><code>if ( function_exists( 'register_nav_menus' ) ) {
  	register_nav_menus(
  		array(
  		  'foot_menu' =&gt; 'My Custom Footer Menu',
  		  'sidebar_menu' =&gt; 'Super Sidebar Menu'
  		)
  	);
}</code></pre>
<div class="image-wrap">
<img src="http://digwp.com/wp-content/uploads/menuspresent.png" alt="" title="menuspresent" width="450" height="128" class="alignnone size-full wp-image-2639" />
</div>
<h3>2. Create menu in Admin</h3>
<p>Now that the feature is enabled, go to Appearance > Menus and build and save a custom menu.</p>
<p><img src="http://digwp.com/wp-content/uploads/menus-step2.png" alt="" title="menus-step2" width="590" height="463" class="alignnone size-full wp-image-2640" /></p>
<h3>3. Attach custom menu to your &#8220;declared&#8221; menu</h3>
<p>Now that you&#8217;ve declared a menu (in functions.php) and built a menu (in the admin), you&#8217;ll need to connect them to each other.</p>
<p><img src="http://digwp.com/wp-content/uploads/menu-step3.png" alt="" title="menu-step3" width="590" height="463" class="alignnone size-full wp-image-2641" /></p>
<h3>4. Insert the menu into the theme</h3>
<p>Now anywhere in your theme you want to display that menu, use:</p>
<pre><code>&lt;?php wp_nav_menu( array('menu' =&gt; 'Footer Menu' )); ?&gt;</code></pre>
<p>Change the name of the menu in the code above to match whatever you named the menu in the admin. This very site uses a WordPress 3.0 menu in the footer. The output HTML looks like this:</p>
<pre><code>&lt;ul class="menu" id="menu-footer-menu"&gt;&lt;li class="menu-item menu-item-type-post_type menu-item-2636" id="menu-item-2636"&gt;&lt;a href="http://digwp.com/contact/"&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-item menu-item-type-post_type menu-item-2633" id="menu-item-2633"&gt;&lt;a href="http://digwp.com/about/"&gt;About&amp;nbsp;Site&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-item menu-item-type-post_type menu-item-2634" id="menu-item-2634"&gt;&lt;a href="http://digwp.com/advertising/"&gt;Advertising&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-item menu-item-type-post_type menu-item-2635" id="menu-item-2635"&gt;&lt;a href="http://digwp.com/archives/"&gt;Archives&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<h3>5. Rejoice</h3>
<p>Now any time this menu needs to be updated, we can do it from the comfort of the WordPress admin area.</p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/08/using-menus-in-wordpress-3-0/">Permalink</a> | <a href="http://digwp.com/2010/08/using-menus-in-wordpress-3-0/#comments">48 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2010/08/using-menus-in-wordpress-3-0/&title=Using Menus in WordPress 3.0">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/function/" rel="tag">function</a>, <a href="http://digwp.com/tag/menu/" rel="tag">menu</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/08/using-menus-in-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Thumbnail Based Archives</title>
		<link>http://digwp.com/2010/07/thumbnail-based-archives/</link>
		<comments>http://digwp.com/2010/07/thumbnail-based-archives/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:36:44 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[archives]]></category>
		<category><![CDATA[loop]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=2604</guid>
		<description><![CDATA[Here at Digging Into WordPress, we&#8217;ve attached thumbnail images to every single (non-link-style) post since day one. We started before WordPress 3.0 had the specific feature for thumbnails. We did it just by attaching a file path to the thumbnail image as a custom field. We clearly display each of those thumbnails in the design [...]]]></description>
			<content:encoded><![CDATA[<p>Here at Digging Into WordPress, we&#8217;ve attached thumbnail images to every single (non-link-style) post since day one. We started before WordPress 3.0 had the specific feature for thumbnails. We did it just by attaching a file path to the thumbnail image as a custom field. We clearly display each of those thumbnails in the design of the homepage and other various pages where it makes sense. </p>
<p>The biggest reason we decided to attach post thumbnails from the beginning was that it is just an interesting bit of data to have available for every single post. It means that we could do something like display random thumbnails in the sidebar, or display thumbnails next to search results. We don&#8217;t do either of those things in this current design, but it&#8217;s always a possibility and possibilities are awesome. </p>
<p>Another thing that is a cool thing to build with thumbnails is unique archive views. I&#8217;ve <a href="http://digwp.com/archives/horz/">built one</a> for us here on Digging Into WordPress and I have some ideas for several more. Check it out:</p>
<p><a href="http://digwp.com/archives/horz/"><img src="http://digwp.com/wp-content/uploads/horzarchives.png" alt="" title="horzarchives" width="590" height="253" class="alignright size-full wp-image-2611" /></a></p>
<p>Read on for the &#8220;how&#8221;&#8230;</p>
<p><span id="more-2604"></span></p>
<h3>1. Created a special page template</h3>
<p>This page will be totally unique, no standard header or footer, so I made a template just for it.</p>
<pre><code>&lt;?php
/*
  Template Name: Thumb Archives - Horz
*/
?&gt;</code></pre>
<h3>2. Creating a horizontal row of thumbs</h3>
<p>One of the best ways to create long horizontal row (that breaks the width of the browser window width) is to use a table with a single row of cells. This way we don&#8217;t have to manually set the width of anything, and also don&#8217;t have to worry about things wrapping as we would if the thumbnails were inline elements or floated. </p>
<p>So we&#8217;ll set up a loop querying for every single post on the site (that isn&#8217;t a link-post) and spit out a table cell for each. Within that table cell, there will be an anchor link pointing to the post which contains a title, the image, and an excerpt.</p>
<pre><code>&lt;table id="archives-table"&gt;
	&lt;tr&gt;
		&lt;?php query_posts('posts_per_page=-1&amp;cat=-52'); ?&gt;
		&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
		&lt;td&gt;
			&lt;a href="&lt;?php the_permalink(); ?&gt;" class="article-block"&gt;
				&lt;span class="title"&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;
				&lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, 'PostThumb', true); ?&gt;" alt="" /&gt;
				&lt;span class="ex"&gt;&lt;?php the_excerpt(); ?&gt;&lt;/span&gt;
			&lt;/a&gt;
		&lt;/td&gt;
		&lt;?php endwhile; endif; ?&gt;
	&lt;/tr&gt;
&lt;/table&gt;</code></pre>
<h3>3. Dependencies</h3>
<p>We&#8217;re going to need a unique CSS file to use for this. Since this template is completely one-off and we aren&#8217;t using the standard header, the &lt;head> element will be right in this template. We&#8217;ll link out to our own custom CSS file, load in jQuery, and load in some plugins that will facilitate the idea I&#8217;m trying to accomplish (<a href="http://www.2meter3.de/code/hoverFlow/">hoverflow</a> and <a href="http://brandonaaron.net/code/mousewheel/docs">mousewheel</a>), as well as finally our own custom JavaScript file.</p>
<pre><code>&lt;head&gt;
  &lt;meta charset="UTF-8" /&gt;
  &lt;title&gt;Thumbnail Archives | Digging Into WordPress&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" media="all" href="&lt;?php bloginfo("template_url"); ?&gt;/css/archives-horz.css" /&gt;
  &lt;script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'&gt;&lt;/script&gt;
  &lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/jquery.hoverflow.min.js'&gt;&lt;/script&gt;
  &lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/jquery.mousewheel.min.js'&gt;&lt;/script&gt;
  &lt;script src='&lt;?php bloginfo("template_url"); ?&gt;/js/weirdarchives.js'&gt;&lt;/script&gt;
&lt;/head&gt;</code></pre>
<p>If this page was anything more than a one-off page, we should be enqueuing scripts and providing proper hooks in the header and such. I&#8217;ve specifically not done that here because this page is it&#8217;s own unique thing that I don&#8217;t want anything else intruding upon. </p>
<h3>4. Style</h3>
<p>The styling for page is very simple, just a repeating background image and resets. Notice on the page though that the titles and excerpts are hidden until the mouse hovers over the thumbnails. We&#8217;ll do the &#8220;hiding&#8221; by setting the opacity of the thumbnails down to zero in the CSS. We&#8217;ll also position them inset into the thumbnail a bit so they have a bit more dramatic &#8220;reveal&#8221; upon mouse hover, as they slide out and into place.</p>
<pre><code>.title { bottom: 50%; }
.ex { top: 50%; font: 11px Georgia, Serif; color: #555; }
.title, .ex { background: white; width: 130px; padding: 10px; display: block; overflow: hidden; position: absolute; opacity: 0; }
</code></pre>
<h3>5. Horizontal scrolling</h3>
<p>With the mousewheel plugin in place, we can force the window to scroll horizontally instead of vertically with mouse scrollwheels with this:</p>
<pre><code>$("body").mousewheel(function(event, delta) {
    this.scrollLeft -= (delta * 30);
    event.preventDefault();
});</code></pre>
<h3>6. Animation</h3>
<p>When a thumbnail is hovered over, the title and except will show themselves and slide down. To do that, I&#8217;m using jQuery&#8217;s hover function which accepts a function to run on mouseenter and a function to run on mouseleave. For the former, an animation begins which moves the position, height, and opacity. The latter, those values are returned to how they started.</p>
<pre><code>$blocks.hover(function(e) {
    var $el    = $(this),
        $title = $el.find(".title"),
        $ex    = $el.find(".ex");
    
    $title.hoverFlow(e.type, { bottom: "99%", opacity: 1, height: $title.data("origHeight") })
    $ex.hoverFlow(e.type, { top: "95.5%", opacity: 1, height: $ex.data("origHeight") });
    
}, function(e) {
    $(this)
        .find(".title").hoverFlow(e.type, { bottom: "50%", opacity: 0, height: 0 })
        .end()
        .find(".ex").hoverFlow(e.type, { top: "50%", opacity: 0, height: 0 });
});</code></pre>
<p>There is a bit more to the JavaScript (but not much), feel free to poke your way around to it from the demo page to see it all.</p>
<h3>7. More</h3>
<p>The point of all this was to create a unique archive browsing experience based around our thumbnails. This isn&#8217;t the only way to do it. In fact I have a few other ideas I&#8217;m going to work on in time. Are they super practical? Maybe not, but they are fun! </p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/07/thumbnail-based-archives/">Permalink</a> | <a href="http://digwp.com/2010/07/thumbnail-based-archives/#comments">15 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2010/07/thumbnail-based-archives/&title=Thumbnail Based Archives">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/archives/" rel="tag">archives</a>, <a href="http://digwp.com/tag/loop/" rel="tag">loop</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/07/thumbnail-based-archives/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Poll: HTML or XHTML for Markup?</title>
		<link>http://digwp.com/2010/04/poll-html-or-xhtml-for-markup/</link>
		<comments>http://digwp.com/2010/04/poll-html-or-xhtml-for-markup/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 16:38:31 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[polls]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1964</guid>
		<description><![CDATA[HTML5 is rapidly gaining popularity, but how many people are actually using it? If not HTML5, then what? When creating websites, designers have a variety of options for markup: HTML5 (Not quiite official yet) HTML 4.01 (Strict, Transitional, Frameset) XHTML 1.0 (Strict, Transitional, Frameset, &#38; Basic) XHTML 1.1 (+ Basic XHTML 1.1) You can build [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 is rapidly gaining popularity, but how many people are actually using it? If not HTML5, then what? When creating websites, designers have a variety of options for markup:</p>
<ul>
<li><strong>HTML5</strong> (Not <em>quiite</em> official yet)</li>
<li><strong>HTML 4.01</strong> (Strict, Transitional, Frameset)</li>
<li><strong>XHTML 1.0</strong> (Strict, Transitional, Frameset, &amp; Basic)</li>
<li><strong>XHTML 1.1</strong> (+ Basic XHTML 1.1)</li>
</ul>
<p>You can build beautiful websites using any of these languages, but each comes with its own pros and cons. For example, you get some <a href="http://www.w3.org/TR/html5-diff/" title="HTML5 differences from HTML4">great new features with HTML5</a>, but JavaScript is required to ensure cross-browser compatibility. XHTML 1.0 is cool, but Internet Explorer doesn&rsquo;t really get it. Likewise, XHTML 1.1 is clean and flexible, but a little more persnickety about the details. <a href="http://www.zeldman.com/2009/07/02/xhtml-wtf/" title="XHTML DOA WTF">And whatever happened to XHTML <strong>2</strong></a>?</p>
<p>In a cage match, which markup language would dominate? <strong>Cast your vote</strong>!</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p><span id="more-1964"></span></p>
<p>Bonus question: How many of us will be around for HTML6? ;)</p>
<p><small>Note: If you are reading via feed, visit the <a href="http://digwp.com/" title="Digging into WordPress">DiW site</a> to take the poll (located in the sidebar).</small></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/04/poll-html-or-xhtml-for-markup/">Permalink</a> | <a href="http://digwp.com/2010/04/poll-html-or-xhtml-for-markup/#comments">39 comments</a> | Add to <a href="http://del.icio.us/post?url=http://digwp.com/2010/04/poll-html-or-xhtml-for-markup/&title=Poll: HTML or XHTML for Markup?">del.icio.us</a> | Post tags: <a href="http://digwp.com/tag/polls/" rel="tag">polls</a><br/></small></p>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/04/poll-html-or-xhtml-for-markup/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
	</channel>
</rss>

