<?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>Matthew Simo &#187; starkers-html</title>
	<atom:link href="http://matt-simo.com/tag/starkers-html/feed/" rel="self" type="application/rss+xml" />
	<link>http://matt-simo.com</link>
	<description>Front-End Designer/Developer</description>
	<lastBuildDate>Mon, 01 Feb 2010 21:51:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>html5 Comments in WordPress &#8211; quickfix</title>
		<link>http://matt-simo.com/html5-comments-quickfix/</link>
		<comments>http://matt-simo.com/html5-comments-quickfix/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:16:29 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[nathan stains]]></category>
		<category><![CDATA[starkers-html]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://matt-simo.com/?p=326</guid>
		<description><![CDATA[Introduction I&#8217;m not even going to acknowledge my terrible blogging habits ( or in reality, lack thereof ) and get to a little something something that will hopefully be of some use to someone. With html5 making a lot of &#8230; <a href="http://matt-simo.com/html5-comments-quickfix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Introduction</h5>
<p>I&#8217;m not even going to acknowledge my terrible blogging habits ( or in reality, lack thereof ) and get to a little something something that will hopefully be of some use to someone.</p>
<p>With html5 making a lot of noise and gaining steam ( <a href="http://mashable.com/2010/01/26/google-voice-web-app/">Google Voice</a> &#038; <a href="http://www.youtube.com/html5">Youtube</a> as examples ), it&#8217;s only a matter of time.</p>
<p>On January 25th, 2010, a nice chap by the name of <a href="http://nathanstaines.com/">Nathan Staines</a> released his html5 version of <a href="http://elliotjaystocks.com/">Elliot Jay Stocks</a>&#8216; <a href="http://elliotjaystocks.com/starkers/">Starkers</a> theme.</p>
<p>As I&#8217;m still in the process of learning the nuances of html5 I decided to use Starkers html5 as a learning ground. Being a <a href="http://twitter.com/matthewsimo">typical twitter user</a> I <a href="http://twitter.com/matthewsimo/status/8417509972">let the world know what I was up to</a>. Nathan fairly quickly <a href="http://twitter.com/nathanstaines/status/8424452760">responded</a>, asking my thoughts and recommendations on any adjustments, I <a href="http://twitter.com/matthewsimo/status/8429465764">replied</a> in kind. </p>
<p>I sat down to see if I could tackle it, I&#8217;ve always been a bit wary of messing with the comments code for wordpress seeing as recursive code can get complicated if you don&#8217;t know exactly what is going on. I thought it was an excellent opportunity to learn and I came up with a (mostly) strait forward quick fix for now. I still want to go back and rewrite the wp_list_comments(); function but that will have to wait as I have other priorities.</p>
<h5>My quick fix:</h5>
<h6>In the comments.php template file find this bit of code: </h6>
<pre><code>&lt;?php wp_list_comments(...); ?&gt; </code></pre>
<p>We&#8217;ll be using this instead:</p>
<pre><code>&lt;?php wp_list_comments('style=div&amp;callback=html5_comment&amp;end-callback=html5_closecomment'); ?&gt;
'</code></pre>
<h6>In your theme&#8217;s functions.php file we&#8217;ll be adding the following code:</h6>
<pre><code>// Changes the trailing &lt;/li&gt; into a trailing &lt;/article&gt;
function html5_closecomment() {?&gt;
	&lt;/article&gt;
&lt;?php
	}

// This is the new comment markup - edit as you feel necessary
function html5_comment($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?&gt;

	&lt;article id="comment-&lt;?php comment_ID() ?&gt;" &lt;?php comment_class(); ?&gt;&gt;
		&lt;header class="comment-author vcard"&gt;
			&lt;?php echo get_avatar($comment,$size='48',$default='&lt;path_to_url&gt;' ); ?&gt;

			&lt;?php printf(__('&lt;cite class="fn"&gt;%s&lt;/cite&gt; <span class="says">says:</span>'), get_comment_author_link()) ?&gt;

			&lt;p&gt;&lt;time pubdate&gt;<a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?&gt;"&gt;&lt;?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?&gt;</a>&lt;?php edit_comment_link(__('(Edit)'),'  ','') ?&gt;&lt;/time&gt;&lt;/p&gt;

			&lt;p&gt;&lt;?php echo $args ['style']; ?&gt;&lt;/p&gt;

		&lt;/header&gt;
		&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
			&lt;p&gt;<em>&lt;?php _e('Your comment is awaiting moderation.') ?&gt;</em>&lt;/p&gt;
		&lt;?php endif; ?&gt;

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

		&lt;footer class="reply"&gt;&lt;?php comment_reply_link(array_merge( $args, array('depth' =&gt; $depth, 'max_depth' =&gt; $args['max_depth']))) ?&gt;&lt;/footer&gt;

&lt;?php
	}</code></pre>
<p>This will force your comments to display like the following:</p>
<pre><code>
&lt;article&gt;
<!-- comment stuff -->
    &lt;article&gt; <!-- depth-2 -->
    <!--  comment stuff -->
    &lt;/article&gt;
&lt;/article&gt;
...
...</code></pre>
<h5>A couple of notes</h5>
<p>Usually, theme&#8217;s wrap the <code>wp_list_comments();</code> call in an ordered list, this isn&#8217;t necessary for our super awesome html5 anymore since articles can (and I guess <a href="http://dev.w3.org/html5/spec/Overview.html#the-article-element">should</a>) be nested. Personally I wrapped it in a div with &#8220;the_comments&#8221; as a class ( For styling purposes mainly. ).</p>
<p>These are the only changes I made to the <a href="http://drp.ly/j57c">starkers html5</a>, take a look for yourself. </p>
<p>Feel free to use, modify and share as you like. Try to give references where they are due though, that&#8217;s all I ask. </p>
<p>Once I rewrite the function for wp_list_comments to handle &#8216;style=article&#8217; I&#8217;ll let you all know.</p>
<h5>More on html5</h5>
<p><a href="http://dev.w3.org/html5/spec/Overview.html">W3C html5 spec overview</a></p>
<p><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">WhatWG.org html5 Working Draft</a></p>
<p><a href="http://html5doctor.com/">html5Doctor</a></p>
<p><a href="http://html5gallery.com/">html5 Gallery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://matt-simo.com/html5-comments-quickfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

