<?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>Chad Coleman &#187; Tricks</title>
	<atom:link href="http://c.hadcoleman.com/cat/tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://c.hadcoleman.com</link>
	<description>WordPress, Content Management Systems and eCommerce Web Specialist</description>
	<lastBuildDate>Fri, 13 Aug 2010 18:00:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Timthumb and Shortcodes for Easy Wordpress Images</title>
		<link>http://c.hadcoleman.com/2010/08/timthumb-and-shortcodes-for-easy-wordpress-images/</link>
		<comments>http://c.hadcoleman.com/2010/08/timthumb-and-shortcodes-for-easy-wordpress-images/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 21:51:50 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[shortcodes]]></category>
		<category><![CDATA[timthumb]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com/?p=498</guid>
		<description><![CDATA[Here&#8217;s a quick and easy way to update image sizes on the fly directly in your Wordpress posts. Add this code into your functions.php file in your theme. Then make sure you insert timthumb.php in the root of your theme directory. Next create a fully writable directory named &#8216;cache&#8217; and place that in your theme [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick and easy way to update image sizes on the fly directly in your Wordpress posts. Add this code into your functions.php file in your theme. Then make sure you insert <a href="http://timthumb.googlecode.com/svn/trunk/timthumb.php">timthumb.php</a> in the root of your theme directory. Next create a fully writable directory named &#8216;cache&#8217; and place that in your theme root directory.</p>
<p>Now inside your posts just wrap an image URL with the img shortcode. Add height, width, alt, and class to it for more flexibility.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p498code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4982"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p498code2"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Image resize in content  </span>
<span style="color: #666666; font-style: italic;">// To Use: [img w=600 h=200 class=alignleft alt=My Photo]http://mysite.com/photo.jpg[/img]</span>
<span style="color: #000000; font-weight: bold;">function</span> timmyimg<span style="color: #009900;">&#40;</span><span style="color: #000088;">$atts</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span>shortcode_atts<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'w'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'600'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'h'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'250'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignnone'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'alt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$atts</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;&lt;img src='&quot;</span><span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/timthumb.php?src=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$content</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;w=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$w</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;h=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$h</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' alt=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$alt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; class='wp-post-img &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$class</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'img'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'timmyimg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<img src='http://c.hadcoleman.com/wp-content/themes/chadcoleman/thumb.php?src=http://c.hadcoleman.com/wp-content/uploads/2010/08/forrest_chadcoleman.jpg&w=500&h=200' alt=Forrest class='wp-post-img alignnone' /><br />
<br/><br />
<img src='http://c.hadcoleman.com/wp-content/themes/chadcoleman/thumb.php?src=http://c.hadcoleman.com/wp-content/uploads/2010/08/forrest_chadcoleman.jpg&w=100&h=100' alt=Forrest class='wp-post-img alignnone' />
<img src='http://c.hadcoleman.com/wp-content/themes/chadcoleman/thumb.php?src=http://c.hadcoleman.com/wp-content/uploads/2010/08/forrest_chadcoleman.jpg&w=382&h=100' alt=Forrest class='wp-post-img alignleft' />
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=498&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2010/08/timthumb-and-shortcodes-for-easy-wordpress-images/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wordpress Thumbnails Outside The Loop</title>
		<link>http://c.hadcoleman.com/2010/06/wordpress-thumbnails-outside-the-loop/</link>
		<comments>http://c.hadcoleman.com/2010/06/wordpress-thumbnails-outside-the-loop/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 19:44:50 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[the_post_image]]></category>
		<category><![CDATA[the_post_thumbnail]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com/?p=490</guid>
		<description><![CDATA[Occasionally you&#8217;ll need to fetch a posts image outside of the loop.

?View Code PHP1
2
3
4
5
6
&#60;?php  
    $thumb = get_post_meta&#40;$post-&#62;ID,'_thumbnail_id',false&#41;;
    $thumb = wp_get_attachment_image_src&#40;$thumb&#91;0&#93;, false&#41;;
    $thumb = $thumb&#91;0&#93;;?&#62;
&#160;
   &#60;img src=&#34;&#60;?php  echo $thumb; ?&#62;&#34; alt=&#34;&#34; /&#62;

Combine this with the Timthumb script for control over image size.
Not [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally you&#8217;ll need to fetch a posts image outside of the loop.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p490code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4906"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p490code6"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  
    <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'_thumbnail_id'</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> wp_get_attachment_image_src<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumb</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$thumb</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
   <span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php  echo <span style="color: #006699; font-weight: bold;">$thumb</span>; ?&gt;&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;</span></pre></td></tr></table></div>

<p>Combine this with the <a href="http://c.hadcoleman.com/2008/06/adding-timthumb-to-your-wordpress-theme/">Timthumb script</a> for control over image size.</p>
<h3>Not Recommended, But Available Option</h3>
<p>This will output the URL to an image with the size predefined by &#8216;post-thumbnail&#8217; in your functions file when registering the functionality for post images.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p490code7'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4907"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p490code7"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  
    <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'_thumbnail_id'</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> wp_get_attachment_image_src<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumb</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my-custom-size'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$thumb</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$thumb</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The above code is referencing &#8216;my-custom-size&#8217;, which we can see below as being 405&#215;180. Typically <a href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/#comment-3053">it is not advised</a> to use these predefined sizes as it will overload your uploads directory with additional sizes, and it puts strain on your server when uploading images. Better to use the above method with the <a href="http://c.hadcoleman.com/2008/06/adding-timthumb-to-your-wordpress-theme/">Timthumb script</a> to get an exact image size, while making use of image caching.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p490code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4908"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p490code8"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'add_theme_support'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Added in 2.9</span>
	add_theme_support<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	set_post_thumbnail_size<span style="color: #009900;">&#40;</span> 50<span style="color: #339933;">,</span> 50<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Normal post thumbnails</span>
	add_image_size<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my-custom-size'</span><span style="color: #339933;">,</span> 405<span style="color: #339933;">,</span> 180<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=490&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2010/06/wordpress-thumbnails-outside-the-loop/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Design Color Scheme From A Photograph</title>
		<link>http://c.hadcoleman.com/2010/02/design-color-scheme-from-a-photograph/</link>
		<comments>http://c.hadcoleman.com/2010/02/design-color-scheme-from-a-photograph/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:31:43 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[color scheme]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com/?p=435</guid>
		<description><![CDATA[As a designer I find inspiration for color schemes from all over. From architecture, nature, to paintings and photographs. I&#8217;ve driven by houses with a great color scheme and thought to myself &#8220;That would make a great color scheme for a website!&#8221;.
Using Photoshop&#8217;s Filter > Pixelate > Mosaic, we can grab a photograph and find [...]]]></description>
			<content:encoded><![CDATA[<p>As a designer I find inspiration for color schemes from all over. From architecture, nature, to paintings and photographs. I&#8217;ve driven by houses with a great color scheme and thought to myself &#8220;That would make a great color scheme for a website!&#8221;.</p>
<p>Using Photoshop&#8217;s <strong>Filter > Pixelate > Mosaic</strong>, we can grab a photograph and find a great scheme from it! Hover the below photos to see the scheme they produce at 65 cell size. Photographs with a wide array of colors will work best.</p>
<p><a href="javascript:;" id="colorscheme01"><img src="http://c.hadcoleman.com/wp-content/uploads/2010/02/colorscheme-01.jpg" /></a></p>
<p><a href="javascript:;" id="colorscheme02"><img src="http://c.hadcoleman.com/wp-content/uploads/2010/02/colorscheme-02.jpg" /></a></p>
<p><a href="javascript:;" id="colorscheme03"><img src="http://c.hadcoleman.com/wp-content/uploads/2010/02/colorscheme-03.jpg" /></a></p>
<style type="text/css">
<!--
a#colorscheme01 {height:320px;width: 500px;overflow: hidden;display: block;padding:0;margin:0;}
a#colorscheme01 img {margin-top: -328px;border:none;}
a#colorscheme01:hover img {margin-top: -3px;}
a#colorscheme01:hover {height:320px;}
a#colorscheme02 {height:320px;width: 500px;overflow: hidden;display: block;padding:0;margin:0;}
a#colorscheme02 img {margin-top: -328px;border:none;}
a#colorscheme02:hover img {margin-top: -3px;}
a#colorscheme02:hover {height:320px;}
a#colorscheme03 {height:320px;width: 500px;overflow: hidden;display: block;padding:0;margin:0;}
a#colorscheme03 img {margin-top: -328px;border:none;}
a#colorscheme03:hover img {margin-top: -3px;}
a#colorscheme03:hover {height:320px;}
-->
</style>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=435&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2010/02/design-color-scheme-from-a-photograph/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Embed Facebook Fan Page Photo Albums In WordPress</title>
		<link>http://c.hadcoleman.com/2010/01/embed-facebook-fan-page-photo-albums-in-wordpress/</link>
		<comments>http://c.hadcoleman.com/2010/01/embed-facebook-fan-page-photo-albums-in-wordpress/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 04:26:45 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[albums]]></category>
		<category><![CDATA[fotobook]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com/?p=423</guid>
		<description><![CDATA[It is a great idea to have a Facebook fan page for your company, club or organization.
This is a minor hack of the Fotobook plugin (Version 3.1.8) for WordPress by Aaron Harp. Fotobook is originally meant to apply your personal photo albums into WordPress, but we&#8217;re going to make one small code tweak to instead [...]]]></description>
			<content:encoded><![CDATA[<p>It is a great idea to have a Facebook fan page for your company, club or organization.</p>
<p>This is a minor hack of the <a href="http://wordpress.org/extend/plugins/fotobook/download/">Fotobook plugin (Version 3.1.8)</a> for WordPress by <a href="http://www.aaronharp.com/dev/wp-fotobook/">Aaron Harp</a>. Fotobook is originally meant to apply your personal photo albums into WordPress, but we&#8217;re going to make one small code tweak to instead pull the albums from the fan page that we administer.</p>
<p>After installing the plugin, go ahead and activate it and grant the permissions to your Facebook account. </p>
<p>Next, visit your Facebook fan page, and click into an album so you&#8217;re viewing all photos in one particular album. In the address bar you&#8217;ll see a <em>&#038;id=123123123</em>. Copy that ID number. </p>
<p><img src="http://c.hadcoleman.com/wp-content/uploads/2010/01/fotobook-post.jpg" alt="" title="fotobook-post" width="499" height="196" class="alignnone size-full wp-image-424" /></p>
<p>In the plugin directory open the fotobook.php file and head down to line 243 and look for this code.</p>
<p><code>$uid = $session['uid'];</code></p>
<p>Swap that code for this</p>
<p><code>//$uid = $session['uid'];<br />
$uid = 123123123;</code></p>
<p>With the 123123123 being the ID code for your fan page.</p>
<p>If you have a custom URL set for your fan page you might notice that the album photos are not showing. To correct that move down around line 809 in fotobook.php and look for:</p>
<p><code>if(!is_numeric($id)) return false;</code></p>
<p>And code it out of use by adding // in front so that it now looks like</p>
<p><code>//if(!is_numeric($id)) return false;</code></p>
<p>Back in the plugin administration page, go ahead and import your albums. And you should be good to go!</p>
<p><small>With a thanks to B. Thibault in the forums at the <a href="http://www.facebook.com/topic.php?uid=2254862517&#038;topic=10155">Fotobook Application Page</a>.</small></p>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=423&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2010/01/embed-facebook-fan-page-photo-albums-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Remove and Prevent Revisions in Wordpress</title>
		<link>http://c.hadcoleman.com/2009/06/remove-and-prevent-revisions-in-wordpress/</link>
		<comments>http://c.hadcoleman.com/2009/06/remove-and-prevent-revisions-in-wordpress/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 19:49:51 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[revisions]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com?p=259</guid>
		<description><![CDATA[I recently noticed that a particular post had built up about 10 or 15 revisions for it. I started thinking that of all the posts I have, there have to be quite a few revisions and therefore are creating a hefty sized table in my database. This was run on my WP 2.8, but should [...]]]></description>
			<content:encoded><![CDATA[<p>I recently noticed that a particular post had built up about 10 or 15 revisions for it. I started thinking that of all the posts I have, there have to be quite a few revisions and therefore are creating a hefty sized table in my database. This was run on my WP 2.8, but should work for 2.6 and up.</p>
<p>Here is a solution to prevent revisions from being created, as well as removing all revisions from your database.</p>
<h3>Prevent Revision Creation</h3>
<p>Open wp-config.php and add this to the very bottom of the file, before the php closing tag.</p>
<p><code>define('WP_POST_REVISIONS', false);</code></p>
<p>This completely turns off any revision creation. If you&#8217;d like to restrict revision creation to a set amount per post, you can change &#8216;false&#8217; for the number of revisions you&#8217;d like stored.</p>
<h3>Remove All Revisions From Database</h3>
<p>Open up your database in phpmyadmin and run this SQL Query.</p>
<p><code>DELETE FROM wp_posts WHERE post_type = "revision";</code></p>
<p>And now you&#8217;ll have a more tidy database.</p>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=259&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2009/06/remove-and-prevent-revisions-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Script Switch Page to HTTPS</title>
		<link>http://c.hadcoleman.com/2009/04/php-script-switch-page-to-https/</link>
		<comments>http://c.hadcoleman.com/2009/04/php-script-switch-page-to-https/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 03:29:00 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com?p=220</guid>
		<description><![CDATA[Here is a quick php script that you can add to the top of any page you want to be secure. Obviously, it requires you actually have an SSL Certificate all set up on your domain first.

?View Code PHP1
2
3
4
5
6
7
8
9
10
&#60;?php
if&#40;empty&#40;$_SERVER&#91;'HTTPS'&#93;&#41;&#41;
&#123;
    // If not, redirect
    $newurl = 'https://'.$_SERVER&#91;'SERVER_NAME'&#93;.$_SERVER&#91;'REQUEST_URI'&#93;;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick php script that you can add to the top of any page you want to be secure. Obviously, it requires you actually have an SSL Certificate all set up on your domain first.<span id="more-220"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p220code10'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p22010"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p220code10"><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><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;">'HTTPS'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// If not, redirect</span>
    <span style="color: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'https://'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location: <span style="color: #006699; font-weight: bold;">$newurl</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=220&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2009/04/php-script-switch-page-to-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Wordpress On a Local Server</title>
		<link>http://c.hadcoleman.com/2009/04/install-wordpress-on-a-local-server/</link>
		<comments>http://c.hadcoleman.com/2009/04/install-wordpress-on-a-local-server/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 19:07:02 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com?p=191</guid>
		<description><![CDATA[In this tutorial, we&#8217;ll go through the process of setting up a server on your local computer. This will allow you to run PHP &#038; MySQL applications, such as Wordpress, directly on your machine.
As I have yet resisted joining the ranks of the Mac cult, we&#8217;ll be using PC server software. I am aware of [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">In this tutorial, we&#8217;ll go through the process of setting up a server on your local computer. This will allow you to run PHP &#038; MySQL applications, such as Wordpress, directly on your machine.</p>
<p>As I have yet resisted joining the ranks of the <a href="http://c.hadcoleman.com/wp-content/uploads/2009/04/apple-cult.jpg">Mac cult</a>, we&#8217;ll be using PC server software. I am aware of <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a>, <a href="http://www.wampserver.com/en/">WAMP</a>, and I personally use <a href="http://vertrigo.sourceforge.net/">VertrigoServ</a> for no other reason than it is the only one I&#8217;ve tried. (Mac cultists can use <a href="http://www.mamp.info/">MAMP</a>.)</p>
<h3>This Tutorial Is Based On <a href="http://vertrigo.sourceforge.net/">VertrigoServ</a></h3>
<p>They say that cleanliness is next to godliness, and in that vein let us install our server in a organized location. On my desktop, I actually use a whole separate hard drive to store my server. If you don&#8217;t have the luxury of a dedicated HDD, then your local disk or C:\ will be fine.</p>
<h3>01. Installing The Server</h3>
<p>Create the following directory: <code>C:\usr\</code>. Then run the server installer, and be sure to install the software in the <code>C:\usr\</code> location.  If you installed the VertrigoServ software, then the &#8220;public web&#8221; files will be located in <code>C:\usr\www\</code>. So let&#8217;s <a href="http://wordpress.org/download">download</a> and install Wordpress inside <code>C:\usr\www\wordpress\</code> and then be sure to fire the server up after installation.</p>
<h3>02. Setup The Database</h3>
<p>So we&#8217;ll need to have a database created before we can install Wordpress. In your web browser, navigate to <a href="http://localhost/phpmyadmin">http://localhost/phpmyadmin</a> and login. There should be the default user and password if this is your first time. Find it by clicking the VertrigoServ icon in the bottom right tray, and selecting &#8220;Help and Readme&#8221;. Be sure to change your passwords once you get in. Default login is root/vertrigo.</p>
<p>Now that we&#8217;re in PHPmyAdmin, let&#8217;s create a database for our local Wordpress install. Type in your desired database name, and hit the &#8220;Create&#8221; button.</p>
<p><img src="http://c.hadcoleman.com/wp-content/uploads/2009/04/wpdb-create.jpg" alt="wpdb-create" title="wpdb-create" width="500" height="172" class="alignnone size-full wp-image-199" /></p>
<h3>03. Installing Wordpress</h3>
<p>With the database created, we can now input our database details into the <code>wp-config.php</code> file of our WP install.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p191code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p19112"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p191code12"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// ** MySQL settings ** //</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'database_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// The name of the database from step 2</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'root'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// Vertrigo uses root as the default username</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'vertrigo_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// the password used to get into your local phpmyadmin</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// 99% chance you won't need to change this value</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_CHARSET'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'utf8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_COLLATE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now we can pull open our browser, and navigate to <a href="http://localhost/wordpress">http://localhost/wordpress</a> and begin the installation of Wordpress. </p>
<p class="info">The <code>http://localhost/</code>  address looks into the <code>\usr\www\</code> directory. So whatever the name of the directory we installed in, is what we&#8217;ll need to punch in after localhost/. For example, if I installed an application in <code>\usr\cms\</code>, I will need to navigate to http://localhost/cms in order to pull up that site.</p>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=191&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2009/04/install-wordpress-on-a-local-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Show Hidden Files in Dreamweaver</title>
		<link>http://c.hadcoleman.com/2009/04/show-hidden-files-in-dreamweaver/</link>
		<comments>http://c.hadcoleman.com/2009/04/show-hidden-files-in-dreamweaver/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 00:24:19 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dreamweaver]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com?p=201</guid>
		<description><![CDATA[Are you tired of not being able to see the .htaccess and other apache files on the server side? No sweat. Let&#8217;s just navigate to the Files section in our sidebar. 
Click the &#8220;Options&#8221; icon, and navigate to View > Show Hidden Files.

]]></description>
			<content:encoded><![CDATA[<p>Are you tired of not being able to see the .htaccess and other apache files on the server side? No sweat. Let&#8217;s just navigate to the Files section in our sidebar. </p>
<p>Click the &#8220;Options&#8221; icon, and navigate to View > Show Hidden Files.</p>
<p><img src="http://c.hadcoleman.com/wp-content/uploads/2009/04/hidden-files-dreamweaver.jpg" alt="hidden files in dreamweaver" title="hidden files in dreamweaver" width="500" height="351" class="alignnone size-full wp-image-205" /></p>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=201&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2009/04/show-hidden-files-in-dreamweaver/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Web Design Tricks</title>
		<link>http://c.hadcoleman.com/2009/01/web-design-tricks/</link>
		<comments>http://c.hadcoleman.com/2009/01/web-design-tricks/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 23:22:35 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com?p=105</guid>
		<description><![CDATA[Here is a round up of some very useful tricks and snippets for web designers.

Resizeable Background Image with jQuery
15 Wicked CSS Tricks
Build a jQuery Interactive Map
Better Way To Register the WP Sidebar

]]></description>
			<content:encoded><![CDATA[<p>Here is a round up of some very useful tricks and snippets for web designers.</p>
<ul>
<li><a href='http://css-tricks.com/how-to-resizeable-background-image/'>Resizeable Background Image with jQuery</a></li>
<li><a href="http://devsnippets.com/reviews/css-code-snippets-15-wicked-tricks.html">15 Wicked CSS Tricks</a></li>
<li><a href="http://www.newmediacampaigns.com/page/jquery-vs-flash-for-interactive-map">Build a jQuery Interactive Map</a></li>
<li><a href="http://wpengineer.com/wordpress-and-register_sidebar">Better Way To Register the WP Sidebar</a></li>
</ul>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=105&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2009/01/web-design-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comment Design For Wordpress 2.7</title>
		<link>http://c.hadcoleman.com/2009/01/comment-design-for-wordpress-27/</link>
		<comments>http://c.hadcoleman.com/2009/01/comment-design-for-wordpress-27/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 10:48:16 +0000</pubDate>
		<dc:creator>Chad Coleman</dc:creator>
				<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://c.hadcoleman.com?p=101</guid>
		<description><![CDATA[If you&#8217;re a Wordpress theme developer, I&#8217;m sure you&#8217;ve run into the problem of styling, and altering comments in your theme. Now that comments are called through a loop to allow for the much anticipated threaded comments feature, we&#8217;ll have to make use of our function file to style the comments.
If you&#8217;re like most every [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a Wordpress theme developer, I&#8217;m sure you&#8217;ve run into the problem of styling, and altering comments in your theme. Now that comments are called through a loop to allow for the much anticipated threaded comments feature, we&#8217;ll have to make use of our function file to style the comments.</p>
<p>If you&#8217;re like most every other developer, the first thing you want to get rid of is the &#8220;says&#8221; that follows the authors name. Now we can do it, without having to set the CSS to display none.</p>
<p><strong>01.</strong> In your theme directory, open up functions.php. If you don&#8217;t have this file, go ahead and create one.</p>
<p><strong>02.</strong> Let&#8217;s create the function &#8216;<em>mytheme_comment</em>&#8216; and paste it into our <em>functions.php</em> file.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code17'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10117"><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
</pre></td><td class="code" id="p101code17"><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>
   <span style="color: #339933;">&lt;</span>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<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;li-comment-&lt;?php comment_ID() ?&gt;&quot;</span><span style="color: #339933;">&gt;</span>
     <span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment-&lt;?php comment_ID(); ?&gt;&quot;</span><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;comment-author vcard&quot;</span><span style="color: #339933;">&gt;</span>
         <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;">'48'</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>
         <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>
      <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&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;">$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>
         <span style="color: #339933;">&lt;</span>em<span style="color: #339933;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?</span>php _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><span style="color: #339933;">&lt;/</span>em<span style="color: #339933;">&gt;</span>
         <span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&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>
      <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;comment-meta commentmetadata&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo htmlspecialchars( get_comment_link( <span style="color: #006699; font-weight: bold;">$comment-&gt;comment_ID</span> ) ) ?&gt;&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?</span>php <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><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?</span>php 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><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
      <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: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;reply&quot;</span><span style="color: #339933;">&gt;</span>
         <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>
      <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
     <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<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>Looking at this code, you can see exactly what you want to do to style your comments accordingly. After you&#8217;re happy with how you want it, the next step is to create the callback from our &#8216;wp_list_comments&#8217; in the <em>comments.php</em> file.</p>
<p><strong>03.</strong> Open up comments.php in your theme directory, and search for wp_list_comments. Control + F should make short work of that.</p>
<p>The default theme has this exact call:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10118"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p101code18"><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: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>So we&#8217;ll just use the function name that we created in step 2 (<em>mytheme_comment</em>), and call it as a variable:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10119"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p101code19"><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>And now, we&#8217;ll see the styling reflected in our comments! </p>
<h3>Separate Comments From Trackbacks</h3>
<p>And for another good tip, you should separate your comments from your trackbacks. It&#8217;s just good manners. </p>
<p>In your <em>comments.php</em> file you can create two lists, and call the loop twice. Only for each loop, you can specify which type of comment/trackback is called. Example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p101code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p10120"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p101code20"><pre class="php" style="font-family:monospace;">	<span style="color: #339933;">&lt;</span>h3 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment_title&quot;</span><span style="color: #339933;">&gt;</span>Comments<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>ol <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;commentlist&quot;</span><span style="color: #339933;">&gt;</span>
            <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&amp;callback=mytheme_comment'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>      
		<span style="color: #339933;">&lt;/</span>ol<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>h3 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;trackback_title&quot;</span><span style="color: #339933;">&gt;</span>Trackbacks<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>ol id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pings&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;trackback&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type=pings'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		<span style="color: #339933;">&lt;/</span>ol<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>For some complete code, and even some jQuery for a toggle hide switch on the trackbacks, be sure to read the <a href="http://curtishenson.com/separating-and-hiding-trackbacks-with-jquery-in-wordpress-27/">article by Curtis Henson</a>.</p>
<img src="http://c.hadcoleman.com/?ak_action=api_record_view&id=101&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://c.hadcoleman.com/2009/01/comment-design-for-wordpress-27/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
