<?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>zoombody &#187; wordpress</title>
	<atom:link href="http://zoombody.com/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://zoombody.com</link>
	<description>by Dan Rice</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:37:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Styling WordPress 2.7 author comments</title>
		<link>http://zoombody.com/articles/styling-wordpress-27-author-comments</link>
		<comments>http://zoombody.com/articles/styling-wordpress-27-author-comments#comments</comments>
		<pubDate>Fri, 23 Jan 2009 00:42:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://zoombody.com/?p=129</guid>
		<description><![CDATA[Styling post author or registered user comments on your WordPress 2.7 blog is much easier than it was back in ol&#8217; 2.6. The new wp_list_comments() template tag (or comment_class() if you&#8217;re doing it the hard way) automatically includes class names like byuser and bypostauthor for easy CSS styling. Slick.
See the official 2.7 theme migration guide [...]]]></description>
			<content:encoded><![CDATA[<p>Styling post author or registered user comments on your WordPress 2.7 blog is <em>much</em> easier than it was <a href="http://zoombody.com/articles/styling-wordpress-author-comments">back in ol&#8217; 2.6</a>. The new <a href="http://codex.wordpress.org/Template_Tags/wp_list_comments"><code>wp_list_comments()</code></a> template tag (or <code>comment_class()</code> if you&#8217;re doing it the hard way) automatically includes class names like <code>byuser</code> and <code>bypostauthor</code> for easy CSS styling. Slick.</p>
<p>See the official <a href="http://codex.wordpress.org/Migrating_Plugins_and_Themes_to_2.7/Enhanced_Comment_Display">2.7 theme migration guide</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://zoombody.com/articles/styling-wordpress-27-author-comments/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Styling WordPress author comments</title>
		<link>http://zoombody.com/articles/styling-wordpress-author-comments</link>
		<comments>http://zoombody.com/articles/styling-wordpress-author-comments#comments</comments>
		<pubDate>Tue, 10 Jun 2008 01:46:58 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://zoombody.com/?p=11</guid>
		<description><![CDATA[Update: these instructions don&#8217;t apply to WordPress 2.7+. See my newer article for more information.
Ever wonder how to apply special styles to highlight WordPress comments written by the post author or another registered user? Good advice on this point is very rare. Most recommendations are to check against either an email address or a specific [...]]]></description>
			<content:encoded><![CDATA[<div class="callout"><strong>Update:</strong> these instructions don&#8217;t apply to WordPress 2.7+. See <a href="http://zoombody.com/articles/styling-wordpress-27-author-comments">my newer article</a> for more information.</div>
<p>Ever wonder how to apply special styles to highlight WordPress comments written by the post author or another registered user? Good advice on this point is very rare. Most recommendations are to check against either an email address or a specific user ID. Both of these options are kludges, and both are fragile.</p>
<p>Here&#8217;s the right way to do it:<span id="more-11"></span></p>
<p>If you want to check whether a comment is by the page author, this is the condition you want to test:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_id</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_author</span></pre></div></div>

<p>To see whether a comment is by a registered user, check this:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_id</span> <span style="color: #339933;">&gt;</span> <span style="color:#800080;">0</span></pre></div></div>

<p>I compiled these into <a href='http://zoombody.com/wordpress/wp-content/uploads/2008/06/zb-user-comments.zip'>a <em>very</em> simple plugin</a>. It has three functions:</p>
<ul>
<li><strong>zb_author_comment()</strong> &#8212; Returns true if the comment is by the post author. Use it conditionally:

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> zb_author_comment<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// do author-specific stuff</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</li>
<li><strong>zb_user_comment()</strong> &#8212; Returns true if the comment is by a registered user. Again, use it conditionally:

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> zb_user_comment<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// do user-specific stuff</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</li>
<li><strong>zb_comment_classes()</strong> &#8212; Outputs <code>user</code> and/or <code>author</code>, if applicable. Useful as CSS classes.
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;">&lt;div class=&quot;comment <span style="color: #000000; font-weight: bold;">&lt;?php</span> zb_comment_classes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;...&lt;/div&gt;</pre></div></div>

<p>would output class names that could be styled with the following CSS selectors:</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;"><span style="color: #6666ff;">.comment</span><span style="color: #6666ff;">.user</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.comment</span><span style="color: #6666ff;">.author</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.comment</span><span style="color: #6666ff;">.author</span><span style="color: #6666ff;">.user</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

</li>
</ul>
<p>Enjoy!</p>
<p>If there&#8217;s an even slicker way to do either of these checks, I&#8217;d love to hear about it &#8212; please post in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://zoombody.com/articles/styling-wordpress-author-comments/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
