<?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>Asnio &#187; colored widgets</title>
	<atom:link href="http://asnio.com/tags/colored-widgets/feed/" rel="self" type="application/rss+xml" />
	<link>http://asnio.com</link>
	<description>Young Entrepreneurs Blog</description>
	<lastBuildDate>Mon, 05 Apr 2010 13:37:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Create Colored Widget Boxes Displaying Recent Posts, Popular Posts, and More</title>
		<link>http://asnio.com/create-colored-widget-boxes-thesis/</link>
		<comments>http://asnio.com/create-colored-widget-boxes-thesis/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 04:00:23 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Thesis Thursday]]></category>
		<category><![CDATA[colored widgets]]></category>
		<category><![CDATA[thesis tutorials]]></category>

		<guid isPermaLink="false">http://asnio.com/?p=561</guid>
		<description><![CDATA[One thing I have received the most attention about regarding the design of this blog are those yellow boxes in my sidebar that display random posts on the blog. People like it, and I got a comment on my last Thesis Thursday post asking how to create that box. I decided that this week I [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="tweetmeme_button" style="float: right; padding: 0 0 1em 1em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fasnio.com%2Fcreate-colored-widget-boxes-thesis%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fasnio.com%2Fcreate-colored-widget-boxes-thesis%2F&amp;source=AlexFraiser&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p class="intro"><span class="drop_cap">O</span>ne thing I have received the most attention about regarding the design of this blog are those yellow boxes in my sidebar that display random posts on the blog. People like it, and I got a comment on my last Thesis Thursday post asking how to create that box.</p>
<p><span id="more-561"></span></p>
<p>I decided that this week I would create a simple tutorial to show you how I did that effect here because I think it is a pretty cool trick.</p>
<p class="note">This tutorial is easily adaptable for use on non-Thesis blogs, but for the sake of the series — the code will be written with Thesis in mind.</p>
<h3>1. Preparations</h3>
<p>Just to get a little prepared here, these are the things you will need for this tutorial.</p>
<ul>
<li>Access to the <code>custom.css</code> file</li>
<li>Depending on what box you want (or if you even want more than one of them), you will need to use plugins from <a href="http://wordpress.org/extend/plugins/profile/robmarsh">Rob Marsh</a>. Your choices are:
<ul>
<li><a href="http://wordpress.org/extend/plugins/recent-comments-plugin/">Recent Comments</a></li>
<li><a href="http://wordpress.org/extend/plugins/popular-posts-plugin/">Popular Posts</a></li>
<li><a href="http://wordpress.org/extend/plugins/random-posts-plugin/">Random Posts</a></li>
<li><a href="http://wordpress.org/extend/plugins/recent-posts-plugin/">Recent Posts</a></li>
<li>…for any one of those plugins, you need the <a href="http://wordpress.org/extend/plugins/post-plugin-library/">Post-Plugin Library</a> for them to work.</li>
</ul>
</li>
<li>Add a Widget in your Widgets panel</li>
</ul>
<p>Once you choose what plugin you want, download it, install it and add it within your Widgets panel. Simple enough preparing, right? As long as you know what you want, the hard stuff is out of the way.</p>
<h3>2. The CSS</h3>
<p>Depending on the plugin you use, the CSS will be different. But the only difference is the <code>#ID</code> that is used, and that is easily changeable.  So, the CSS code I use here is pretty simple, but I will explain it:</p>
<pre><span style="color: red;font-weight: bold;">#random-posts</span> li {
	background: #FFFBCC;
	border: 1px solid #E6DB55;
	line-height: 1.4em;
	-moz-border-radius: 5px;
	padding: 0.9em;
	-webkit-border-radius: 5px;
}</pre>
<p>So what we have going on up there is pretty simple. We have a background which will allow you to switch up the color of the box, the border will surround the whole think, the line height controls the spacing between each line of the link, and the padding is the spacing from the box to the text. The <code>-moz-border-radius</code> &amp; <code>-webkit-border-radius</code> will make the box rounded without images. They will only be round in Safari and Firefox, but it’s a neat trick to those who can actually see it.</p>
<p>I have colored in <code>#random-posts</code> because that is the thing that will change depending on which plugin you choose. </p>
<p>The ID’s you will need to use for the other plugins are below:</p>
<ul>
<li><code>#recent-posts</code></li>
<li><code>#popular-posts</code></li>
<li><code>#recent-comments</code></li>
</ul>
<h3>3. Customizing the output</h3>
<p><img class="alignright size-full wp-image-580" title="Default Widgets Look" src="http://asnio.com/wp-content/uploads/2009/05/b1eedba69ea68b89781038a88b8dddb4.png" alt="Default Widgets Look" width="239" height="464" />You should have the yellow box around the link by default. It looks kind of boring, but because of how flexible this plugin is, making it look better is not a problem at all.</p>
<p>There are a lot of different things you can add to the box to make it look cool. The plugin makes adding things so simple too, and you really don’t need any coding knowledge at all  to do it.</p>
<p>So to start, go to <em>Settings → Recent Comments/Recent Posts/Random/Popular Posts → Output → Output Template</em>. This is where we can add anything to the box.  I will go over the two things I added to my boxes, which i think look sexy as hell.</p>
<h4>66x66 Image</h4>
<p><em>This will only work if you use Thesis teasers and have the 66x66 images for each post</em></p>
<p>You can paste this code into the Output Template box:</p>
<pre>&lt;li&gt;&lt;a href="{url}"&gt;&lt;img src="{custom:thesis_thumb}" width="66" height="66" alt="" /&gt;&lt;/a&gt;{link}&lt;/li&gt;</pre>
<p class="alert"><strong>NOTE:</strong> If you let Thesis auto generate thumbnails, replace <code>thesis_thumb</code> with <code>thesis_post_image</code> in the code above.</p>
<p>The code calls the <code>thesis_thumb</code> custom field from your posts and puts it into the box. You will also need to add this CSS to make the image look right:</p>
<pre><span style="color: red;font-weight: bold;">#random-posts</span> img { float: left; padding-right: 8px; }</pre>
<h4>Add the date, and other stuff</h4>
<p>If you look in my box, there is a date of when the post was published. The date can be replaces with a variety of things like comment count, views, tags, and a lot more. The code below will show you how to float things to the right.</p>
<p>First, replace the code in your <em>Output Template</em> with this:</p>
<pre>&lt;li&gt;&lt;a href="{url}"&gt;&lt;img src="{custom:thesis_thumb}" width="48" height="48" alt="" /&gt;&lt;/a&gt;{link} &lt;div class="right"&gt;{date}&lt;/div&gt;&lt;/li&gt;</pre>
<p>Add this to your CSS:</p>
<pre><span style="color: red;font-weight: bold;">#random-posts</span> div.right { color: #baaf2e; float: right; font-size: 11px; text-transform: uppercase; }</pre>
<p>I added a little style to change the font color, size and case. This will bring whatever you wrap within <code>&lt;div class="right"&gt;...&lt;/div&gt;</code> to the right. But there will be a bug.</p>
<div id="attachment_588" class="wp-caption alignleft" style="width: 229px">
	<img class="size-full wp-image-588" title="Box without overflow:hidden" src="http://asnio.com/wp-content/uploads/2009/05/1196d50bd7d1aec532a0432b47d6f29f.png" alt="If you look towards the bottom of my box here, you will see a slight overlap" width="229" height="82" />
	<p class="wp-caption-text">If you look towards the bottom of my box here, you will see a slight overlap</p>
</div>
<p>You will also need to add <code>overflow: hidden;</code> to the very first piece of code you added in Step 2. When the image is in the box floating, it will overlap the box, making it looks really weird. So, by adding that line to your CSS, it will make it look right, and the text will be inside of the box again.</p>
<h3>Simple Enough, Wasn’t It?</h3>
<p>That was pretty simple wasn’t it? The plugins used in this tutorial are extremely powerful, and allow you to customize your output extensively. </p>
<p>I hope you enjoyed this tutorial, as it was the first tutorial in the series.  I hope you stick around for more posts here, and next week’s Thesis Thursday post! Is there anything you guys want covered for next Thursday?  </p>
<p>PS: This is a really cool Thesis resource. Matt Langford wrote up a kick ass list of <a href="http://mattflies.com/tech/100-resources-for-thesis-wordpress-theme-users/">100 Resources For Thesis</a> you guys should definitely check out!</p>
<p>MAY 21ST, 2009</p>
]]></content:encoded>
			<wfw:commentRss>http://asnio.com/create-colored-widget-boxes-thesis/feed/</wfw:commentRss>
		<slash:comments>127</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->