<?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>cdevroe.com &#187; kubrick</title>
	<atom:link href="http://cdevroe.com/tag/kubrick/feed/" rel="self" type="application/rss+xml" />
	<link>http://cdevroe.com</link>
	<description>by Colin Devroe</description>
	<lastBuildDate>Thu, 24 May 2012 15:29:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>	<atom:link rel='hub' href='http://cdevroe.com/?pushpress=hub'/>
<cloud domain='cdevroe.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Using hCard in WordPress comments</title>
		<link>http://cdevroe.com/notes/hcard-in-wordpress-comments/</link>
		<comments>http://cdevroe.com/notes/hcard-in-wordpress-comments/#comments</comments>
		<pubDate>Thu, 20 Apr 2006 13:20:16 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[hcard]]></category>
		<category><![CDATA[kubrick]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://cdevroe.com/notes/hcard-in-wordpress-comments/</guid>
		<description><![CDATA[You too can help support the semantic Web.  Marking up your comments properly in Wordpress, is just one way.  Here's how.]]></description>
			<content:encoded><![CDATA[<p>A technical article, from me?  There are some very good reasons I stopped releasing code to the world, but I think I have very good reasons I am going to start up again.</p>
<p>Today, we&#8217;re going to be learning how to format our comments, for <a href="http://wordpress.org/">WordPress</a>, to work within the <a href="http://microformats.org/wiki/hcard">hCard</a> spec.  If you are unaware what <a href="http://microformats.org/">microformats</a> are, what hCard is, or why you might consider doing this on your site, please take a few minutes to read the microformats site.</p>
<p>As a side note:  Even if you do not see yourself trying to directly benefit from using hCard in your comments, others will.  Adding hCard syntax to your existing comments on WordPress is painless, and should not effect your layout at all.  So do it anyway!</p>
<h3>Current WordPress comment markup</h3>
<p>Obviously, this markup depends on the theme you are using, but I&#8217;m going to show you the most common example, and you can hopefully adapt it to your current theme.</p>
<p>The following is the markup found in <a href="http://binarybonsai.com/">Michael Heilemann</a> and <a href="http://chrisjdavis.org/">Chris J. Davis&#8217;</a><a href="http://binarybonsai.com/wordpress/kubrick/">Kubrick</a>, which comes pre-installed with every copy of WordPress and is, by default, chosen as your theme.  This theme has been customized thousands of times, and so most of you out there should be familiar with this markup.</p>
<pre>&lt;li class="&lt;?php echo $oddcomment; ?&gt;" id="comment-&lt;?php comment_ID() ?&gt;"&gt;
	&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:
	&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
	&lt;em&gt;Your comment is awaiting moderation.&lt;/em&gt;
	&lt;?php endif; ?&gt;
	&lt;br /&gt;

	&lt;small class="commentmetadata"&gt;
		&lt;a href="#comment-&lt;?php comment_ID() ?&gt;" title=""&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('e','',''); ?&gt;
	&lt;/small&gt;

	&lt;?php comment_text() ?&gt;

&lt;/li&gt;</pre>
<p>This markup is replicated, by WordPress, for every comment you have on each post.  So, how do we make this hCard compatible?</p>
<p>There are a few essential elements to a hCard.  The first, is marking up where the actual hCard is.  In this case, we&#8217;re going to use the <code>cite</code> tag since that is where we have the commentor&#8217;s first name, last name, and url to their website.  The second essential element would be the annotation of the commentor&#8217;s formatted name.  To do this, we need to add 3 class names to your comments.</p>
<ul>
<li><strong>vcard:</strong>  This signifies the beginning of an hCard</li>
<li><strong>fn:</strong> This signifies the formatted name (or the way that the user would like their name shown).</li>
<li><strong>url:</strong> The home url for the commentor.</li>
</ul>
<p>There has been some discussions in the world of microformats recently about being able to uniquely target single hCards on a page with multiple hCards, hence I am also going to add an ID to each hCard, so that if something takes off in this area, your comments will already be compatible.  So, below is the code that you may use inside of Kubrick v1.5 for your commentor&#8217;s information to be marked up as hCards.</p>
<pre>&lt;li class="&lt;?php echo $oddcomment; ?&gt;" id="comment-&lt;?php comment_ID() ?&gt;"&gt;
			&lt;cite id="vcard-&lt;?php comment_ID() ?&gt;" class="vcard"&gt;&lt;a class="url fn" href="&lt;?php comment_author_url(); ?&gt;"&gt;&lt;?php comment_author(); ?&gt;&lt;/a&gt;&lt;/cite&gt; Says:
			&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
			&lt;em&gt;Your comment is awaiting moderation.&lt;/em&gt;
			&lt;?php endif; ?&gt;
			&lt;br /&gt;

			&lt;small class="commentmetadata"&gt;&lt;a href="#comment-&lt;?php comment_ID() ?&gt;" title=""&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('e','',''); ?&gt;&lt;/small&gt;

			&lt;?php comment_text() ?&gt;

		&lt;/li&gt;</pre>
<p>It really is just that easy.  Again, adding these few classes should not effect your layout, and can be installed painlessly into your site, for your benefit and ours.</p>
<p><a href="http://digg.com/programming/Using_hCard_Microformat_in_Wordpress_Comments">Digg this article</a> to help others find it.</p>
<p>[tags]wordpress, kubrick, microformats, hcard, xhtml, semantics[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://cdevroe.com/notes/hcard-in-wordpress-comments/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

