<?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>bavotasan.com &#187; img</title>
	<atom:link href="http://bavotasan.com/tag/img/feed/" rel="self" type="application/rss+xml" />
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:42:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>6 Tips to Speed Up jQuery</title>
		<link>http://bavotasan.com/2010/tips-speed-up-jquery/</link>
		<comments>http://bavotasan.com/2010/tips-speed-up-jquery/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 16:10:12 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[attr]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[fff]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Location]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[Properties]]></category>
		<category><![CDATA[selector]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2518</guid>
		<description><![CDATA[As it stands, jQuery is an amazingly efficient JavaScript framework, but there are a few things that you can do when creating your code that will end up slowing it down significantly. I&#8217;ve noticed that a few small changes to my standard way of using jQuery have made my code run a lot faster. 1. [...]]]></description>
			<content:encoded><![CDATA[<p>As it stands, <a href="http://jquery.com/">jQuery</a> is an amazingly efficient JavaScript framework, but there are a few things that you can do when creating your code that will end up slowing it down significantly. I&#8217;ve noticed that a few small changes to my standard way of using <a href="http://jquery.com/">jQuery</a> have made my code run a lot faster.</p>
<h3>1. Be More Specific with Selectors</h3>
<p>When you are setting up <a href="http://jquery.com/">jQuery</a> to search through the DOM for a specific element, the more information you give it, the faster it will find the element. It is also faster to use IDs instead of classes.</p>
<p>Something like this will require going through the whole DOM structure to find the element:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.item&quot;</span><span style="color: #009900;">&#41;</span></pre></div></td></tr></table></div>

<p>These are way more efficient:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// use IDs instead of Classes</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p.first .item&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// be more specific with the location</span></pre></div></td></tr></table></div>

<h3>2. Always Use $(this)  </h3>
<p>If you are using a selector to traverse the DOM in search of an element to perform a specific function on, that element becomes stored and can be manipulated within the function by using <code>$(this)</code>.</p>
<p>This code will traverse the DOM twice to get the same element:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>This is the efficient way since the element is already stored within the <code>$(this)</code> call:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>3. Pass Multiple Selectors</h3>
<p>If you want the same functions to occur on multiple elements, it is possible to group selectors together to increase performance and avoid repetitive traversing of the DOM.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// bad</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#two&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#three&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// good</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#one, p#two, p#three&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>4. Use Multiple Properties and Values</h3>
<p>Many <a href="http://jquery.com/">jQuery</a> methods accept multiple properties and values instead of just a single property and value pair. Including multiple properties will help speeds things up as it reduces the amount of <a href="http://jquery.com/">jQuery</a> objects that are created within your code.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// bad</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'src'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'http://mysite.com/images/image.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'alt'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'My Image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// good</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #3366CC;">'src'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://mysite.com/images/image.jpg'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'alt'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'My Image'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>5. Add Styles with Classes or IDs</h3>
<p>If you want to add multiple style changes to an element, it make more sense to use CSS to assign your styles to a Class or ID, and then add that Class or ID to the element. </p>
<p>Create your styles:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
.<span style="color: #993333;">faster</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#dd0000</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>And instead of doing this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #3366CC;">'background'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'#dd0000'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'color'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'#fff'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'padding'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'5px 8px'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Do this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;faster&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>6. Use Chaining</h3>
<p>Once you have already selected an element, you can chain your commands using <code>.end()</code> instead of traversing the DOM multiple times to find the same element. Understanding chaining might take a bit of trial and error to really get the hang of it. Certain commands require that you <code>.end()</code> the chain and certain don&#8217;t. I&#8217;ll give more in depth tutorial on chaining in the future to help guide you through the ins and outs of it all.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//bad</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div p.one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div p.two&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlight'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//good</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p.one'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p.two'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlight'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>These are just a few things that have helped me make my <a href="http://jquery.com/">jQuery</a> code run more efficiently. There are tons of books and resources out there that can help you take it to the next level to create the most efficient <a href="http://jquery.com/">jQuery</a> code imaginable. Here are a few I suggest:</p>
<ul>
<li><a href="http://jqueryenlightenment.com/">jQuery Enlightenment by Cody Lindley</a></li>
<li><a href="http://www.learningjquery.com/">Learning jQuery</a></li>
<li><a href="http://jqueryfordesigners.com/">jQuery for Designers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/tips-speed-up-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using jQuery for a Simple Animated Fade Effect</title>
		<link>http://bavotasan.com/2010/jquery-simple-animated-fade-effect/</link>
		<comments>http://bavotasan.com/2010/jquery-simple-animated-fade-effect/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 19:57:26 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[opacity]]></category>
		<category><![CDATA[person]]></category>
		<category><![CDATA[piece]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1817</guid>
		<description><![CDATA[I know I have already done a fade effect between two images with jQuery, but here is a quick little piece of code that will just add a nice animated fade effect to single images. Whenever a person hovers over an image, we will use jQuery to lower the opacity to make it appear lighter. [...]]]></description>
			<content:encoded><![CDATA[<p>I know I have already done a fade effect between two images with jQuery, but here is a quick little piece of code that will just add a nice animated fade effect to single images. Whenever a person hovers over an image, we will use jQuery to lower the opacity to make it appear lighter. Easy and not that impressive but still pretty cool.<br />
<span id="more-1817"></span><br />
Make sure you first call jQuery.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">'jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Then just add the following code and all your images will have a slight fade when you hover over them.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
  $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0.8&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>If you only want this to occur on certain images than just make sure to change the first jQuery selector to the class name of the images your want this effect to affect.</p>
<p>Try it out below:</p>
<p><script type="text/javascript">
  jQuery(document).ready(function(){
    jQuery("img.opacity").hover(function() {
      jQuery(this).stop().animate({opacity: "0.8"}, 'slow');
    },
    function() {
      jQuery(this).stop().animate({opacity: "1"}, 'slow');
    });
  });
</script></p>
<p><img src="http://bavotasan.com/wp-content/uploads/2009/09/jquerylogo.png" alt="" title="" width="200" height="150" class="alignleft opacity" /><img src="http://bavotasan.com/wp-content/uploads/2009/07/jquery.png" title="" alt="" width="200" height="150" class="alignleft opacity" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/jquery-simple-animated-fade-effect/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Creating a Mouseover Fade Effect with jQuery</title>
		<link>http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/</link>
		<comments>http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 15:44:42 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[Creating]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Grab]]></category>
		<category><![CDATA[head tags]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mouseover]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[possibilities]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=779</guid>
		<description><![CDATA[My last little jQuery tutorial was an alternative to using CSS to create an image change on a mouseover. Now I want to take that one step further and add a fade effect. For my example, I am going to make a black and white image fade into a color image. To achieve this effect [...]]]></description>
			<content:encoded><![CDATA[<p>My last little jQuery tutorial was an alternative to using CSS to create an image change on a mouseover. Now I want to take that one step further and add a fade effect. For my example, I am going to make a black and white image fade into a color image. To achieve this effect I am going to introduce the <a href="http://docs.jquery.com/Effects/animate">animate function</a>. There are tons of possibilities in regards to jQuery&#8217;s animate function, but for this tutorial, I&#8217;m going to keep it simple by just using it to do one thing.<br />
<span id="more-779"></span><br />
First things first, download <a href="http://jquery.com/">jQuery</a>. Grab the Production minified version off of their site. Next, get two images. I used the following.</p>
<p><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota-bw.jpg" alt="cbavota-bw" title="cbavota-bw" width="150" height="122" class="alignleft size-full wp-image-781" /><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota.jpg" alt="cbavota" title="cbavota" width="150" height="122" class="alignleft size-full wp-image-782" /></p>
<hr style="clear:both;border:0;" />
<p>Add the jQuery script between your head tags.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://yoursite.com/jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Here is the function.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img.a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Here is the CSS.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;style<span style="color: #00AA00;">&gt;</span>
&nbsp;
div<span style="color: #6666ff;">.fadehover</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
img<span style="color: #6666ff;">.a</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">10</span><span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span>
&nbsp;
img<span style="color: #6666ff;">.b</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>And here is the body code.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fadehover&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota-bw.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;a&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;b&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>All together you got something that looks like this.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>jQuery Hover Effect<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">'jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ready<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;img.a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>hover<span style="color: #009900;">&#40;</span>
<span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
div<span style="color: #339933;">.</span>fadehover <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> relative<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
img<span style="color: #339933;">.</span>a <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	left<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	top<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        z<span style="color: #339933;">-</span>index<span style="color: #339933;">:</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
img<span style="color: #339933;">.</span>b <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	left<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	top<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fadehover&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota-bw.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;a&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;b&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Test it out below:</p>
<p><script>
jQuery(document).ready(function(){
	jQuery(".a").hover(
	function() {
		jQuery(this).stop().animate({"opacity": "0"}, "slow");
	},
	function() {
		jQuery(this).stop().animate({"opacity": "1"}, "slow");
	});
});
</script></p>
<div class="fadehover"><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota-bw.jpg" alt="" class="a" /><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota.jpg" alt="" class="b" /></div>
<p>NOTE: If you are using jQuery with WordPress, you need to replace all the dollar signs ($) with the word jQuery due to other Javascript libraries that use the dollar sign.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/feed/</wfw:commentRss>
		<slash:comments>200</slash:comments>
		</item>
		<item>
		<title>How to Add Nested Comments to Your WordPress Theme</title>
		<link>http://bavotasan.com/2009/how-to-add-nested-comments-to-your-wordpress-theme/</link>
		<comments>http://bavotasan.com/2009/how-to-add-nested-comments-to-your-wordpress-theme/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 16:53:55 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[alignright]]></category>
		<category><![CDATA[Amp]]></category>
		<category><![CDATA[bunch]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[custom theme]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[lot]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[someone]]></category>
		<category><![CDATA[Style]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[threaded comments]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[Url]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[web programming]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress hack]]></category>
		<category><![CDATA[Wp]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=333</guid>
		<description><![CDATA[When WordPress 2.7 came out, there were a lot of new features, most of which probably passed by under your radar. I know I missed a bunch and thankfully, I am starting to notice how much more powerful WordPress has become. I had someone request making my Magazine Basic theme function with nested comments and [...]]]></description>
			<content:encoded><![CDATA[<p>When WordPress 2.7 came out, there were a lot of new features, most of which probably passed by under your radar. I know I missed a bunch and thankfully, I am starting to notice how much more powerful WordPress has become. I had someone request making my <a href="http://bavotasan.com/wordpress/free-wordpress-themes/magazine-basic-free-wordpress-theme/">Magazine Basic theme</a> function with nested comments and that started me on researching just how this new WP feature worked. It ended up being a harder nut to crack than I first thought, but crack it I did (though I probably spend way too much time on it).<br />
<span id="more-333"></span><br />
There are quite a few steps to making your theme work with nested comments but the easiest thing to do to start off is open up your theme&#8217;s comments.php file and replace it with this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Do not delete these lines</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">'comments.php'</span> <span style="color: #339933;">==</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Please do not load this page directly. Thanks!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> post_password_required<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: #000000; font-weight: bold;">?&gt;</span>
&lt;p class=&quot;nocomments&quot;&gt;This post is password protected. Enter the password to view comments.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;!-- You can start editing here. --&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> have_comments<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h3 id=&quot;comments&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_number<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Responses'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'One Response'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% Responses'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span> to &amp;#8220;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;#8221;&lt;/h3&gt;
&nbsp;
&lt;div class=&quot;navigation&quot;&gt;
&lt;div class=&quot;alignleft&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_comments_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&lt;div class=&quot;alignright&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> next_comments_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&lt;/div&gt;
&nbsp;
&lt;ol class=&quot;commentlist&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ol&gt;
&nbsp;
&lt;div class=&quot;navigation&quot;&gt;
&lt;div class=&quot;alignleft&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_comments_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&lt;div class=&quot;alignright&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> next_comments_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// this is displayed if there are no comments so far ?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'open'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_status</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!-- If comments are open, but there are no comments. --&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// comments are closed ?&gt;</span>
<span style="color: #339933;">&lt;!--</span> <span style="color: #b1b100;">If</span> comments are closed<span style="color: #339933;">.</span> <span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>p <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nocomments&quot;</span><span style="color: #339933;">&gt;</span>Comments are closed<span style="color: #339933;">.&lt;/</span>p<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'open'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_status</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div id=&quot;respond&quot;&gt;
&nbsp;
&lt;h3&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_form_title<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Leave a Reply'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Leave a Reply to %s'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;
&nbsp;
&lt;div class=&quot;cancel-comment-reply&quot;&gt;
&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> cancel_comment_reply_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;
&lt;/div&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_registration'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$user_ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;You must be &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-login.php?redirect_to=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;logged in&lt;/a&gt; to post a comment.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot;&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;p&gt;Logged in as &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/wp-admin/profile.php&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$user_identity</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;. &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_logout_url<span style="color: #009900;">&#40;</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Log out of this account&quot;&gt;Log out &amp;raquo;&lt;/a&gt;&lt;/p&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_author</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; size=&quot;22&quot; tabindex=&quot;1&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;aria-required='true'&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;
&lt;label for=&quot;author&quot;&gt;&lt;small&gt;Name <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;(required)&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_author_email</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; size=&quot;22&quot; tabindex=&quot;2&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;aria-required='true'&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> /&gt;
&lt;label for=&quot;email&quot;&gt;&lt;small&gt;Mail (will not be published) <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;(required)&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_author_url</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
&lt;label for=&quot;url&quot;&gt;&lt;small&gt;Website&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;!--&lt;p&gt;&lt;small&gt;&lt;strong&gt;XHTML:&lt;/strong&gt; You can use these tags: &lt;code&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> allowed_tags<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/code&gt;&lt;/small&gt;&lt;/p&gt;--&gt;
&nbsp;
&lt;p&gt;&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;Submit Comment&quot; /&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_id_fields<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> do_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_form'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;/form&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// If registration required and not logged in ?&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// if you delete this the sky will fall on your head ?&gt;</span></pre></td></tr></table></div>

<p>Now, you need to make sure that nested comments are activated on your WordPress install by going to your admin panel =&gt; Settings =&gt; Discussion and checking &#8220;Enable threaded (nested) comments&#8221; Set the level to whatever you want. I like using 2 levels.</p>
<p>If you return to a post page on your site, you should now see reply buttons after each post. And if you click reply, you will noticed that not much happens other than &#8220;Click here to cancel reply.&#8221; appearing above your reply window. It is a little too subtle for me, so luckily there is a great Javascript hook already installed that you can call by just adding this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_singular<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'comment-reply'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>to you header.php file above <code>&lt;?php wp_head(); ?&gt;</code>.</p>
<p>Now when you click reply, the reply box appears directly below the comment you want to reply to. This is a great little feature and it makes your comments section more intuitive for your user.</p>
<p>The only thing left, really, is styling your comments. With WordPress 2.7, one hook creates the whole comment loop, as opposed to before when you had to call the avatar, the comment text, the date and all that jazz. There is a lot happening with <code>&lt;?php wp_list_comments(); ?&gt;</code> and though some might find it awesome that you don&#8217;t have to worry about adding tons of code, others might not like the fact that you can&#8217;t edit what appears in your comments and where. There is a solution to this that I will show you below, but for now lets talk about CSS.</p>
<p>WP 2.7 nested comments introduce some new classes and ids for you to style as you wish. It is a pretty long list though.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">ol<span style="color: #6666ff;">.commentlist</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.alt</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.bypostauthor</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.byuser</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment-author-admin</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.comment-author</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> a.<span style="color: #993333;">url</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> img<span style="color: #6666ff;">.avatar</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> img<span style="color: #6666ff;">.avatar-32</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> img<span style="color: #6666ff;">.photo</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.vcard</span> span<span style="color: #6666ff;">.says</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.commentmetadata</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.comment-meta</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.comment-meta</span> a <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span> - <span style="color: #00AA00;">&#40;</span>p<span style="color: #00AA00;">,</span> em<span style="color: #00AA00;">,</span> strong<span style="color: #00AA00;">,</span> blockquote<span style="color: #00AA00;">,</span> ul<span style="color: #00AA00;">,</span> ol<span style="color: #00AA00;">,</span> etc.<span style="color: #00AA00;">&#41;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.reply</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> div<span style="color: #6666ff;">.reply</span> a <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.alt</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.bypostauthor</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.byuser</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.comment</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.comment-author-admin</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-3</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-4</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-5</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.comment</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.odd</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.even</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.odd</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.comment-author</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.vcard</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> a.<span style="color: #993333;">url</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.vcard</span> span<span style="color: #6666ff;">.says</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.commentmetadata</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.comment-meta</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.comment-meta</span> a <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> <span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span> - <span style="color: #00AA00;">&#40;</span>p<span style="color: #00AA00;">,</span> em<span style="color: #00AA00;">,</span> strong<span style="color: #00AA00;">,</span> blockquote<span style="color: #00AA00;">,</span> ul<span style="color: #00AA00;">,</span> ol<span style="color: #00AA00;">,</span> etc.<span style="color: #00AA00;">&#41;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.reply</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.reply</span> a <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.alt</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.bypostauthor</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.byuser</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.comment</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.comment-author-admin</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-3</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-4</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-5</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.odd</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.thread-alt</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.thread-even</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.thread-odd</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The depth actually goes down to level 10 but I stopped at level 5 above. Hopefully you get the idea. There are a lot of elements to style but of course, you don&#8217;t have to style them all. For my <a href="http://bavotasan.com/wordpress/free-wordpress-themes/magazine-basic-free-wordpress-theme/">Magazine Basic theme</a>, I used only the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">ol<span style="color: #6666ff;">.commentlist</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#d5d5d5</span><span style="color: #00AA00;">;</span> border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> -webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">7px</span> <span style="color: #933;">5px</span> <span style="color: #933;">64px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> comment-author <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">170px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.vcard</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> helvetica<span style="color: #00AA00;">,</span>arial<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> a.<span style="color: #993333;">url</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#cc0000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.vcard</span> cite<span style="color: #6666ff;">.fn</span> a.<span style="color: #993333;">url</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.vcard</span> img<span style="color: #6666ff;">.avatar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">7px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.comment-meta</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> helvetica<span style="color: #00AA00;">,</span>arial<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.comment-meta</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#205B87</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li p <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> helvetica<span style="color: #00AA00;">,</span>arial<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li ul <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> helvetica<span style="color: #00AA00;">,</span>arial<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">square</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.reply</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span> border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> -webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span> <span style="color: #933;">9px</span>/<span style="color: #cc66cc;">1</span> helvetica<span style="color: #00AA00;">,</span>arial<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">6px</span> <span style="color: #933;">5px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">36px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.reply</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#cc0000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#cc0000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li div<span style="color: #6666ff;">.reply</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-transform</span><span style="color: #00AA00;">:</span><span style="color: #993333;">uppercase</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li ul<span style="color: #6666ff;">.children</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-2</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-3</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-4</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.depth-5</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.odd</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> ul<span style="color: #6666ff;">.children</span> li<span style="color: #6666ff;">.even</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#f6f6f6</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ol<span style="color: #6666ff;">.commentlist</span> li<span style="color: #6666ff;">.pingback</span> div<span style="color: #6666ff;">.vcard</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">170px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>If you have your nested comment level set to 3 you should now have something that looks like this:</p>
<p><img src="http://bavotasan.com/wp-content/uploads/2009/03/threaded.png" alt="threaded" title="threaded" width="580" height="343" class="aligncenter size-full wp-image-357" /></p>
<p>It all works great but there are a few things that I wanted to change. They don&#8217;t make it that easy to manipulate things but I figured it out and added a few touches of my own to get it to perform how I wanted it to.</p>
<p>To change the size of the avatar you can change line 25 in comments.php to this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'avatar_size=48'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The default avatar size is 32 and you can change it to anything you want.</p>
<p>If you don&#8217;t want your comments to be displayed as the default unordered list (ul), you can change the style to divs or an ordered list (ol) by using the following;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'style=div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Replace div with ol or ul but be sure to also change line 24 and 26 which currently is set for ordered lists so that you have something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;commentlist&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'style=div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre></td></tr></table></div>

<p>If you want to only display comments, trackbacks, pingbacks (trackbacks and pings) or pings, you can use the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type=comment'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now for those people who want total control over their code. This is not recommended to those who are inexperienced with coding. This actually bypasses all of the internal WordPress functionality in regards to comments and lets you customize everything that the wp_list_comments hook spits out. This is a two step process.</p>
<p>First add:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'callback=mytheme_comment'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Then go to your functions.php file (or create a functions.php file if you don&#8217;t already have one) and add this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> mytheme_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$depth</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;li <span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> id=&quot;li-comment-<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_ID<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 id=&quot;comment-<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&lt;div class=&quot;comment-author vcard&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_avatar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span><span style="color: #000088;">$size</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'36'</span><span style="color: #339933;">,</span><span style="color: #000088;">$default</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'&lt;path_to_url&gt;'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;cite class=&quot;fn&quot;&gt;%s&lt;/cite&gt;  &lt;span class=&quot;says&quot;&gt;says:&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> get_comment_author_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_approved</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;em&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Your comment is awaiting moderation.'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/em&gt;
&lt;br /&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div class=&quot;comment-meta commentmetadata&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span>get_comment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_ID</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%1$s at %2$s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> get_comment_date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>get_comment_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_comment_link<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(Edit)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'  '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_text<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'max_depth'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #000088;">$depth</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;reply&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_reply_link<span style="color: #009900;">&#40;</span><span style="color: #990000;">array_merge</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'depth'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$depth</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'max_depth'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'max_depth'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Here there is a lot that you can do. You can set your avatar size, change your classes and ids, change you awaiting moderation text or pretty much just rearrange the entire layout. I even added a little if statement at the end to only display the reply button if your comments can go down another level (this took a long time to figure out but is totally worth it in my books).</p>
<p>With everything above in place, your WordPress theme should now be fit to work with nested comments and you should be able to control how they are displayed to your hearts content.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/how-to-add-nested-comments-to-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>120</slash:comments>
		</item>
		<item>
		<title>Excerpt or Content Word Limit in WordPress: Redux</title>
		<link>http://bavotasan.com/2009/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/</link>
		<comments>http://bavotasan.com/2009/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 18:51:20 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ability]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[Content Word]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[Preg]]></category>
		<category><![CDATA[Programmers]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[return]]></category>
		<category><![CDATA[the_excerpt]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[while]]></category>
		<category><![CDATA[Word Limit]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress hack]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=269</guid>
		<description><![CDATA[This is just a revamp of a function I wrote a while back to add the ability to limit the number of words displayed when you call the excerpt or content. As it stands, the max number of words for the excerpt is 55. There is a new function with WP 2.9 to increase this [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a revamp of a function I wrote a while back to add the ability to limit the number of words displayed when you call the excerpt or content. As it stands, the max number of words for the excerpt is 55. There is a new function with WP 2.9 to increase this number. Check out <a href="http://bavotasan.com/?p=1393">Quick &#038; Easy Excerpt Mods Coming in WordPress 2.9</a> for more on that subject.<br />
<span id="more-269"></span><br />
Add the following code to your functions.php file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>	
  <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`\[[^\]]*\]`'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$excerpt</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> content<span style="color: #009900;">&#40;</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>	
  <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\[.+\]/'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">']]&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']]&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Now, instead of using the_content() or the_excerpt in your loop, use excerpt($limit) or content($limit). </p>
<p>If you want to limit your excerpt to 25 words the code would look like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> excerpt<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>I also created a plugin for this that you can download at <a href="http://wordpress.org/extend/plugins/content-and-excerpt-word-limit/">http://wordpress.org/extend/plugins/content-and-excerpt-word-limit/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>85</slash:comments>
		</item>
		<item>
		<title>Adding a Simple Quicktag to the HTML Editor in WordPress</title>
		<link>http://bavotasan.com/2009/adding-a-simple-quicktag-to-the-html-editor-in-wordpress/</link>
		<comments>http://bavotasan.com/2009/adding-a-simple-quicktag-to-the-html-editor-in-wordpress/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 16:01:19 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Functionality]]></category>
		<category><![CDATA[html editor]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[Location]]></category>
		<category><![CDATA[quicktag]]></category>
		<category><![CDATA[span]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=158</guid>
		<description><![CDATA[When you are editing a post or writing a new post in WordPress, you might have noticed those buttons above the editing box. They add WYSIWYG type functionality to the WordPress editor for common functions such as bolding, italics and linking. WordPress refers to these buttons as Quicktags. They should look something like this if [...]]]></description>
			<content:encoded><![CDATA[<p>When you are editing a post or writing a new post in WordPress, you might have noticed those buttons above the editing box. They add WYSIWYG type functionality to the WordPress editor for common functions such as bolding, italics and linking. WordPress refers to these buttons as Quicktags.<br />
<span id="more-158"></span><br />
They should look something like this if you use the HTML editor.</p>
<p><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/01/quicktags.jpg"><img class="aligncenter size-medium wp-image-159" title="quicktags" src="http://bavotasan.com/wp-content/uploads/2009/01/quicktags-580x32.jpg" alt="quicktags" width="580" height="32" /></a></p>
<p>If you use the Visual editor they should look something like this.</p>
<p><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/01/quicktags2.jpg"><img class="aligncenter size-full wp-image-160" title="quicktags2" src="http://bavotasan.com/wp-content/uploads/2009/01/quicktags2.jpg" alt="quicktags2" width="459" height="33" /></a></p>
<p>If you have a function that you use often it is very simple to add it to the Quicktag bar. For this example, I am going to add a button that creates a span tag and asks for a class to the HTML editor Quicktag bar.</p>
<p>The file we need to work with is under <code>wp-includes/js/quicktags.js</code>.</p>
<p>First we need to create the button, so go to around line 36 and enter the following.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">edButtons<span style="color: #009900;">&#91;</span>edButtons<span style="color: #339933;">.</span>length<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
<span style="color: #000000; font-weight: bold;">new</span> edButton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ed_class'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'span'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">''</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;/span&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #0000ff;">'p'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// special case</span></pre></td></tr></table></div>

<p>Then we need to add the part that actually makes it call the function that asks the user to enter a class name. Find this part around line 166.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>166
167
168
169
170
171
172
173
174
175
176
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> edShowButton<span style="color: #009900;">&#40;</span>button<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>button<span style="color: #339933;">.</span>id <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ed_img'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertImage(edCanvas);&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>button<span style="color: #339933;">.</span>id <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ed_link'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertLink(edCanvas, '</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #0000ff;">');&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, '</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #0000ff;">');&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot;  /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And make it this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>166
167
168
169
170
171
172
173
174
175
176
177
178
179
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> edShowButton<span style="color: #009900;">&#40;</span>button<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>button<span style="color: #339933;">.</span>id <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ed_img'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertImage(edCanvas);&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>button<span style="color: #339933;">.</span>id <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ed_link'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertLink(edCanvas, '</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #0000ff;">');&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>button<span style="color: #339933;">.</span>id <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ed_class'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertClass(edCanvas, '</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #0000ff;">');&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
document<span style="color: #339933;">.</span>write<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;input type=&quot;button&quot; id=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>id <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; accesskey=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>access <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, '</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #0000ff;">');&quot; value=&quot;'</span> <span style="color: #339933;">+</span> button<span style="color: #339933;">.</span>display <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot;  /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And it needs one last part, the actual function, to work properly, so go to the end of the file and add this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>403
404
405
406
407
408
409
410
411
412
413
414
415
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> edInsertClass<span style="color: #009900;">&#40;</span>myField<span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> defaultValue<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>defaultValue<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
defaultValue <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>edCheckOpenTags<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000000; font-weight: bold;">CLASS</span> <span style="color: #339933;">=</span> prompt<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Enter the Image location'</span> <span style="color: #339933;">,</span>defaultValue<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">CLASS</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
edButtons<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>tagStart <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;span class=&quot;'</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">CLASS</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span> edInsertTag<span style="color: #009900;">&#40;</span>myField<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
edInsertTag<span style="color: #009900;">&#40;</span>myField<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>v <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>When it comes down to it, this might actually be a little bit more complicated of a  Quicktag to create but there you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/adding-a-simple-quicktag-to-the-html-editor-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

