<?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>In All Reality &#187; Tutorials</title>
	<atom:link href="http://ryanburrell.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://ryanburrell.com</link>
	<description>I can't be a rockstar...so I do this instead.</description>
	<lastBuildDate>Fri, 22 Apr 2011 14:59:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Add Widget-Capable Sidebars To Your WordPress Theme</title>
		<link>http://ryanburrell.com/2009/01/add-widget-capable-sidebars-to-your-wordpress-theme/</link>
		<comments>http://ryanburrell.com/2009/01/add-widget-capable-sidebars-to-your-wordpress-theme/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 14:00:35 +0000</pubDate>
		<dc:creator>Ryan Burrell</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[sidebars]]></category>
		<category><![CDATA[theme development]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://ryanburrell.com/?p=197</guid>
		<description><![CDATA[Ever wanted to add more widget-capable sections to your WordPress theme?  This article shows you how very simple it is to create an unlimited number of widget-capable areas in your theme and get them to output the way you want them to.  No development knowledge required: copy &#038; paste examples included!]]></description>
			<content:encoded><![CDATA[<p><img title="Widgets!  Widgets everywhere!" src="http://ryanburrell.com/wp-content/uploads/2009/01/widgetsection1.jpg" alt="Widgets!  Widgets everywhere!" width="530" height="200" /></p>
<p>One of the many awesome things about <a title="WordPress" href="http://wordpress.org" target="_blank">WordPress</a> is its ability to support widgetized sections.  The lingo in the WP admin terms these &#8220;sidebars&#8221; but they can be used in any number of other layout orientations; basically, anywhere you would like an easy-to-administer set of widgets.</p>
<p>However, if you&#8217;re like me and aren&#8217;t primarily (or even secondarily) a developer, adding something like a widget-capable section to your WordPress theme is a bit daunting, especially since the <a title="WordPress Widgets Api/register sidebar" href="http://codex.wordpress.org/WordPress_Widgets_Api/register_sidebar" target="_blank">documentation from WordPress is a bit sketchy</a>.  Fear not!  Listed below are some simple steps and code snippets to allow you to add multiple widget-compatible sections to a WordPress theme:</p>
<h2>Step 1: Register Your Sidebar(s)</h2>
<p>The first thing you need to do is create a &#8220;registration&#8221; for each widget-capable section you wish to include in your theme.  To do this, add the following bits of code to your <code>functions.php</code> file in your theme directory:</p>
<ol class="code">
<li><code>&lt;?php</code></li>
<li><code>/* Register sidebar attributes */</code></li>
<li><code>if (function_exists('register_sidebar')) {</code></li>
<li class="tab1"><code>register_sidebar(</code></li>
<li class="tab2"><code>array(</code></li>
<li class="tab2"><code>'name' =&gt; 'Primary Sidebar',</code></li>
<li class="tab2"><code>'before_widget' =&gt; '&lt;li id="%1$s" class="widget %2$s"&gt;',</code></li>
<li class="tab2"><code>'after_widget' =&gt; '&lt;/li&gt;',</code></li>
<li class="tab2"><code>'before_title' =&gt; '&lt;h2 class="widgettitle"&gt;',</code></li>
<li class="tab2"><code>'after_title' =&gt; '&lt;/h2&gt;',</code></li>
<li class="tab2"><code>)</code></li>
<li class="tab1"><code>);</code></li>
<li><code>}</code></li>
<li><code>?&gt; </code></li>
</ol>
<p>Or, if you want multiple sections:</p>
<ol class="code">
<li><code>&lt;?php</code></li>
<li><code>/* Register sidebar attributes */</code></li>
<li><code>if (function_exists('register_sidebar')) {</code></li>
<li class="tab1"><code>register_sidebar(</code></li>
<li class="tab2"><code>array(</code></li>
<li class="tab2"><code>'name' =&gt; 'Primary Sidebar',</code></li>
<li class="tab2"><code>'before_widget' =&gt; '&lt;li id="%1$s" class="widget %2$s"&gt;',</code></li>
<li class="tab2"><code>'after_widget' =&gt; '&lt;/li&gt;',</code></li>
<li class="tab2"><code>'before_title' =&gt; '&lt;h2 class="widgettitle"&gt;',</code></li>
<li class="tab2"><code>'after_title' =&gt; '&lt;/h2&gt;',</code></li>
<li class="tab2"><code>)</code></li>
<li class="tab1"><code>);</code></li>
<li class="tab1"><code>register_sidebar(</code></li>
<li class="tab2"><code>array(</code></li>
<li class="tab2"><code>'name' =&gt; 'Secondary Sidebar',</code></li>
<li class="tab2"><code>'before_widget' =&gt; '&lt;div id="%1$s" class="module %2$s"&gt;',</code></li>
<li class="tab2"><code>'after_widget' =&gt; '&lt;/div&gt;',</code></li>
<li class="tab2"><code>'before_title' =&gt; '&lt;h2 class="title"&gt;',</code></li>
<li class="tab2"><code>'after_title' =&gt; '&lt;/h2&gt;'</code></li>
<li class="tab2"><code>)</code></li>
<li class="tab1"><code>);</code></li>
<li class="tab1"><code>register_sidebar(</code></li>
<li class="tab2"><code>array(</code></li>
<li class="tab2"><code>'name' =&gt; 'Tertiary Sidebar',</code></li>
<li class="tab2"><code>'before_widget' =&gt; '&lt;div id="%1$s" class="module %2$s"&gt;',</code></li>
<li class="tab2"><code>'after_widget' =&gt; '&lt;/div&gt;',</code></li>
<li class="tab2"><code>'before_title' =&gt; '&lt;h2 class="title"&gt;',</code></li>
<li class="tab2"><code>'after_title' =&gt; '&lt;/h2&gt;'</code></li>
<li class="tab2"><code>)</code></li>
<li class="tab1"><code>);</code></li>
<li><code>}</code></li>
<li><code>?&gt; </code></li>
</ol>
<p>In short, this creates a new sidebar listing in your Widgets section of the WordPress admin for each <code>register_sidebar</code> function you call, allowing you to assign widgets to the selected area.  The data in the array following each <code>register_sidebar</code> call assigns a name to the widget-capable section, sets what (if any) HTML is written before and after the widget data is printed out, and set what (if any) HTML is printed before and after the title of the widget, respectively.  The name value is particularly important and must be unique for each registered section, as this is what we will use to tell WordPress where in the theme the specific widget-capable section is supposed to display.</p>
<h2>Step 2: Output Your Sidebar(s)</h2>
<p>After registration in <code>functions.php</code>, it&#8217;s a simple matter of including a bit of code in any file in your theme that you wish to display one, or more, of your new widget-capable sections. The code required for this is very simple:</p>
<ol class="code">
<li><code>&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Name You Gave Your Sidebar Goes Here') ) { ?&gt;</code></li>
<li><code>&lt;?php } ?&gt;</code></li>
</ol>
<p>Just replace the &#8220;<code>Name You Gave Your Sidebar Goes Here</code>&#8221; bit with the name you assigned the particular section in the <code>register_sidebar</code> function in <code>functions.php.</code> For instance, on this site, I&#8217;ve widgetized the footer area, and added code in it like this:</p>
<ol class="code">
<li><code>&lt;div id="col1" class="column"&gt;</code></li>
<li class="tab1"><code>&lt;div id="pandora"&gt;</code></li>
<li class="tab2"><code>&lt;div id="pandora_top"&gt;</code></li>
<li class="tab3"><code>&lt;div id="pandora_top2"&gt;&lt;/div&gt;</code></li>
<li class="tab3"><code>&lt;ul id="pandora_body"&gt;</code></li>
<li class="tab4"><code>&lt;?php pandorafeeds_display_bookmarked_songs(5, true);?&gt;</code></li>
<li class="tab3"><code>&lt;/ul&gt;</code></li>
<li class="tab3"><code>&lt;div id="pandora_btm"&gt;&lt;/div&gt;</code></li>
<li class="tab2"><code>&lt;/div&gt;</code></li>
<li class="tab1"><code>&lt;/div&gt;</code></li>
<li><code>&lt;/div&gt;</code></li>
<li><code>&lt;div id="col2" class="column"&gt;</code></li>
<li class="tab1"><span style="color: #ff6600;"><code>&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Tertiary Sidebar') ) { ?&gt;</code></span></li>
<li class="tab1"><span style="color: #ff6600;"><code>&lt;?php } ?&gt;</code></span></li>
<li><code>&lt;/div&gt;</code></li>
<li><code>&lt;div id="col3" class="column"&gt;</code></li>
<li class="tab1"><span style="color: #ff6600;"><code>&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Quadrary Sidebar') ) { ?&gt;</code></span></li>
<li class="tab1"><span style="color: #ff6600;"><code>&lt;?php } ?&gt;</code></span></li>
<li><code>&lt;/div&gt;</code></li>
</ol>
<p>The first column contains my custom Pandora feed output, but the <span style="color: #ff6600;">orange highlighted</span> snippets in <code>col2</code> and <code>col3</code> tell the theme that any widgets that are assigned to the Tertiary or Quadrary Sidebars are to be placed between the brackets in the <code>IF</code> statements listed there.</p>
<h2>Step 3: Add Some Widgets!</h2>
<p>The last, and easiest part of it all.  Head to the Widgets section of your WordPress admin, and you&#8217;ll find that your new widget-capable sections have been added to the list you can select from:</p>
<p><img title="Selecting your widget section" src="http://ryanburrell.com/wp-content/uploads/2009/01/widgetsection2.jpg" alt="Selecting your widget section" width="250" height="380" /></p>
<p class="clearer">Simply select your section, hit &#8220;Show&#8221;, and add widgets until your heart is content.</p>
<p>I encourage anyone adding extra sections to experiment with their placement.  They can be useful in any number of locations around your page, and possibly even on specific pages or post templates as well.  Plus you&#8217;ll be the envy of the WP theme development crowd :)</p>
<p class="update"><strong>Update</strong>:  I found a post very similar to this one that might be of further help.  <a title="Make Your WordPress Theme Widget-Ready Tutorial" href="http://www.themelab.com/2008/04/18/see-how-easy-it-is-to-widgetize-wordpress-themes/" target="_blank">View it here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanburrell.com/2009/01/add-widget-capable-sidebars-to-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Level The Playing Field: Using A Reset Stylesheet</title>
		<link>http://ryanburrell.com/2008/12/level-the-playing-field-using-a-reset-stylesheet/</link>
		<comments>http://ryanburrell.com/2008/12/level-the-playing-field-using-a-reset-stylesheet/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 14:00:14 +0000</pubDate>
		<dc:creator>Ryan Burrell</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[reset stylesheet]]></category>
		<category><![CDATA[stylesheets]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://ryanburrell.com/?p=131</guid>
		<description><![CDATA[Ever heard of a reset stylesheet?  No?

In this article, we explore what a reset stylsheet is, why it's useful, and why you should be using one.  There's a little history involved, some romance, some action, and intrigue!  Well, not really...except for the history.  We'll even do a rundown of a customized reset stylesheet gleaned from CSS master Eric Meyer.]]></description>
			<content:encoded><![CDATA[<p><img title="Reset Stylesheets: Making things flat and nifty" src="http://ryanburrell.com/wp-content/uploads/2008/12/reset.jpg" alt="A field a barley" width="530" height="180" /></p>
<p>I&#8217;ve discovered as of late that there are a lot of practices that haven&#8217;t been adopted by the web community that have been around for quite some time (meaning a year or two in web terms).  This is particularly surprising to me in some cases simply because of the sheer usefulness of the practice(s) in question.  A lot of this is simply because of ignorance, and I use that term as it was intended, not with any negative connotation.  So, to help correct that, I thought I&#8217;d churn out a quick post on one of the biggest time-savers: the reset stylesheet.</p>
<p>If you&#8217;re unfamiliar with what a reset stylesheet is, the concept is very simple.  So simple, in fact, that once you understand it you&#8217;ll wonder why we haven&#8217;t been using the idea all along.  But to understand why a reset stylesheet is so great, there&#8217;s a bit of a back story.</p>
<h2>A Brief History of Web Browsers and Why They Suck</h2>
<p>The web has been, unbeknownst to most people, a fairly brutal battleground since its inception.  The W3C has been the determining body for what standards browsers and other content devices should adhere to, and they have been soundly ignored from the beginning.  Things really came to a head in the battles between Microsoft and Netscape, with each racing to develop their own proprietary methods that would make developers want to create sites for their browser specifically.</p>
<p>Eventually things calmed down, mostly because of accessibility concerns.  However, the fallout from the earlier battles is apparent in that most browsers still have differing methods of rendering data on the screen.  Things like forms having extra spacing inside them, input fields having their own font families different from the surround elements, lists with varying levels of padding, etc.  This is a <em>huge</em> headache for design and development, to say the least.</p>
<h2>Ok, so what is it?</h2>
<p>A reset stylesheet is a specialized CSS file, or a collection of CSS definitions, that override all default styling provided by a browser for HTML tags with a visual output.  The practical result of such a sheet is that it removes the ambiguity in display, telling all browsers that <em>this</em> has <em>these</em> types of margins and <em>that</em> has <em>this</em> type of padding.</p>
<p>Exactly what a particular reset stylesheet does is, obviously, based on its contents.  Different stylesheets have been developed with varying degrees of specificity as to what styling they apply.  The stlyesheet that I&#8217;ve found to work best for most situations has been one developed by CSS guru, <a href="http://meyerweb.com/" target="_blank">Eric Meyer</a>.  I&#8217;ve made a few modifications to <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">his stylesheet</a> and added a few other items:</p>
<p class="update">Download the stylesheet listed below here: <a href="http://ryanburrell.com/freebies/css/reset.css" target="_blank">Reset Stylesheet</a> (save as&#8230;)</p>
<ol class="code">
<li><code>html, body, div, span, applet, object, iframe,</code></li>
<li><code>blockquote, pre,</code></li>
<li><code>a, abbr, acronym, address, big, cite, code,</code></li>
<li><code>del, dfn, em, font, img, ins, kbd, q, s, samp,</code></li>
<li><code>small, strike, strong, sub, sup, tt, var,</code></li>
<li><code>dl, dt, dd, ol, ul, li,</code></li>
<li><code>fieldset, form, label, legend,</code></li>
<li><code>table, caption, tbody, tfoot, thead, tr, th, td {</code></li>
<li class="tab1"><code>margin: 0;</code></li>
<li class="tab1"><code>padding: 0;</code></li>
<li class="tab1"><code>border: 0;</code></li>
<li class="tab1"><code>outline: 0;</code></li>
<li class="tab1"><code>font-weight: inherit;</code></li>
<li class="tab1"><code>font-style: inherit;</code></li>
<li class="tab1"><code>font-size: 100%;</code></li>
<li class="tab1"><code>font-family: inherit;</code></li>
<li class="tab1"><code>vertical-align: baseline;</code></li>
<li><code>}</code></li>
<li><code>/* remember to define focus styles! */</code></li>
<li><code>:focus {</code></li>
<li class="tab1"><code>outline: 0;</code></li>
<li><code>}</code></li>
<li><code>body {</code></li>
<li class="tab1"><code>line-height: 1;</code></li>
<li class="tab1"><code>color: black;</code></li>
<li class="tab1"><code>background: white;</code></li>
<li class="tab1"><code>/* opacity: .99; text-rendering bug in Fx2/Mac --- doesn't validate */</code></li>
<li><code>}</code></li>
<li><code>h1, h2, h3, h4, h5, h6 {</code></li>
<li class="tab1"><code>margin: 10px 10px 10px 5px;</code></li>
<li class="tab1"><code>padding: 0;</code></li>
<li><code>}</code></li>
<li><code>p {</code></li>
<li class="tab1"><code>margin: 5px;</code></li>
<li class="tab1"><code>padding: 0;</code></li>
<li><code>}</code></li>
<li><code>ol, ul {</code></li>
<li class="tab1"><code>list-style: none;</code></li>
<li><code>}</code></li>
<li><code>/* tables still need 'cellspacing="0"' in the markup */</code></li>
<li><code>table {</code></li>
<li class="tab1"><code>border-collapse: separate;</code></li>
<li class="tab1"><code>border-spacing: 0;</code></li>
<li><code>}</code></li>
<li><code>caption, th, td {</code></li>
<li class="tab1"><code>text-align: left;</code></li>
<li class="tab1"><code>font-weight: normal;</code></li>
<li><code>}</code></li>
<li><code>blockquote:before, blockquote:after,</code></li>
<li><code>q:before, q:after {</code></li>
<li class="tab1"><code>content: "";</code></li>
<li><code>}</code></li>
<li><code>blockquote, q {</code></li>
<li class="tab1"><code>quotes: "" "";</code></li>
<li><code>}</code></li>
<li><code>/* CLEAFIX */</code></li>
<li><code>.clearfix:after {</code></li>
<li class="tab1"><code>content: ".";</code></li>
<li class="tab1"><code>display: block;</code></li>
<li class="tab1"><code>height: 0;</code></li>
<li class="tab1"><code>clear: both;</code></li>
<li class="tab1"><code>visibility: hidden;</code></li>
<li><code>}</code></li>
<li><code>.clearfix {display: inline-block;}</code></li>
<li><code>/* Hides from IE-mac \*/</code></li>
<li><code>* html .clearfix {height: 1%;}</code></li>
<li><code>.clearfix {display: block;}</code></li>
<li><code>/* End hide from IE-mac */</code></li>
<li><code>.clearer {</code></li>
<li class="tab1"><code>clear: both;</code></li>
<li><code>}</code></li>
</ol>
<p>It&#8217;s a bit lengthy, but still a very small overall file as far as size is concerned.  It can obviously be condensed and is presented in its current format for readability.  The notable changes that I&#8217;ve made to Eric&#8217;s base stylesheet have been the addition of the &#8220;clearfix&#8221; methodology (as described at <a href="http://www.webtoolkit.info/css-clearfix.html" target="_blank">Webtoolkit</a>) to the bottom, as well as a utility clearing class that I found myself using in nearly every site.</p>
<p>Briefly, what the above code does:</p>
<ul>
<li>The <code>&lt;html&gt; &lt;body&gt; &lt;div&gt; &lt;span&gt; &lt;form&gt; &lt;ul&gt; &lt;ol&gt;</code> and other tags are all specifically told to have no margins, no padding, no borders, no outlines, and to inherit their font settings from their parent elements.</li>
<li>The <code>&lt;body&gt;</code> is given a default <code>color</code> attribute of <code>black</code> and a default <code>background</code> color of <code>white</code>, so you don&#8217;t have to set these every time you make a new site.</li>
<li>Headings and paragraphs are given a specified set of margins and zero padding.</li>
<li>List items are set to show no bullet or other notation by default (especially useful since most lists tend to end up as navigation or with custom styling).</li>
<li>For browsers with better support of CSS2 &amp; 3 standards, other things like defining a default focus state for form elements are added as well.</li>
<li>The clearfix code snippets allow the application of a <code>clearfix</code> class to any element, resulting in that element clearing itself after all floated elements inside it (<em>extremely </em>useful).</li>
<li>The utility <code>clearer</code> class can be applied to any element, causing it to clear any floats above it.</li>
</ul>
<p>And that&#8217;s basically it.  Here are some important tips and directions:</p>
<ul>
<li>Include your reset stylesheet <em>above all other stylesheets</em>.  People tend to forget that HTML is read in a procedural manner, and if your reset stylesheet is placed below all other stylesheets, it&#8217;s styling will take precendence over the other CSS definitions. &#8220;Thou shalt not have other stylesheets before me.&#8221;</li>
<li>To make your life less of a hassle, <em>always</em> include your reset stylesheet from the very start of your design/development.  Trying to add a reset stylesheet after the fact can sometimes be more of a headache than starting from scratch.</li>
<li>Recycle!  Save your reset stylesheet code as a snippet or simply as a file located somewhere that you can easily copy and paste into any new projects you begin to work on.</li>
</ul>
<p>Thanks to all those people who have developed this idea long before I got hold of it, because it has saved me a ton of time and headache.  Enjoy!</p>
<p class="credit">Image credit: <a href="http://www.sxc.hu/profile/sumeja" target="_blank">sumeja</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ryanburrell.com/2008/12/level-the-playing-field-using-a-reset-stylesheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Making of a Not-So-Boring Search/RSS Widget (Part 2)</title>
		<link>http://ryanburrell.com/2008/12/the-making-of-a-not-so-boring-searchrss-widget-part-2/</link>
		<comments>http://ryanburrell.com/2008/12/the-making-of-a-not-so-boring-searchrss-widget-part-2/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 03:22:10 +0000</pubDate>
		<dc:creator>Ryan Burrell</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[theme modification]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://ryanburrell.com/?p=98</guid>
		<description><![CDATA[In my previous post, I decided I would share my rough methodology on how I went about sprucing up my search widget in WordPress. If you&#8217;re just tuning in, here&#8217;s a quick update on what I described in The Making of a Not-So-Boring Search/RSS Widget: We downloaded some cool Photoshop brushes featured in Smashing Magazine,&#8230;]]></description>
			<content:encoded><![CDATA[<p><img title="Before &amp; After" src="http://ryanburrell.com/wp-content/uploads/2008/12/rss_widget.jpg" alt="Before &amp; after of the rss tab for ryanburrell.com" width="530" height="250" /></p>
<p>In my previous post, I decided I would share my rough methodology on how I went about sprucing up my search widget in WordPress.  If you&#8217;re just tuning in, here&#8217;s a quick update on what I described in <a href="http://ryanburrell.com/xhtml/the-making-of-a-not-so-boring-searchrss-widget">The Making of a Not-So-Boring Search/RSS Widget</a>:</p>
<ul>
<li>We downloaded some cool Photoshop brushes featured in Smashing Magazine, and used one of those to give a torn paper background to the search widget</li>
<li>We took that background and prepped it for use from Photoshop, making minor modifications to include background transparency.</li>
<li>We then modified the HTML for the search widget to accommodate the background styling.</li>
<li>Finally, we added some simple CSS to pull in the background images.</li>
</ul>
<p>Awesome.  But what about the nasty, plain text links below the search area for the post and comment RSS feeds?  Icky.  Bland.  Boring.</p>
<h2>A Different Approach</h2>
<p>Why do these links need to take up so much space?  There&#8217;s no reason that we can&#8217;t compact them down into a single RSS button placed somewhere on the page, but I want to give my readers the ability to subscribe to both the posts and the comments&#8230;so we&#8217;re at a bit of a dilemma.  But wait!  Why can&#8217;t we roll these into a <em>hidden</em> section of the page that is easily accessible?  A lot of sites do have that single button RSS link; this one will just have a special surprise.</p>
<p>Basically, the idea is to do this:</p>
<p><img title="Poor to perfect" src="http://ryanburrell.com/wp-content/uploads/2008/12/rss_widget2.jpg" alt="Before &amp; after of the rss tab for ryanburrell.com" width="530" height="250" /></p>
<h2>Making The Wrapping</h2>
<p>Creating the images is just as easy if not easier than the images for the search background.  I used the <strong>Rounded Rectangle Tool</strong> in Photoshop and then simple used the <strong>Pen Tool</strong> and the <strong>Direct Selection Tool</strong> to add some extra points for the tab curve and tweak the curve outward, respectively.</p>
<p><img title="Dragging the handles on the tab" src="http://ryanburrell.com/wp-content/uploads/2008/12/rss_widget3.jpg" alt="Dragging the handles on the tab" width="317" height="249" /></p>
<p class="clearer">Once I have the shape the way I want it, I add a gradient across the surface in RSS-ish colors.  I add some text and a little RSS icon, and the tab is done.  Then, all I need to do is turn off the background, crop it to just the tab portion (<em>including</em> the curve on the far left), and Save For Web.</p>
<p><img title="Cropping the image" src="http://ryanburrell.com/wp-content/uploads/2008/12/rss_widget5.jpg" alt="Cropping the image" width="411" height="159" /></p>
<p class="clearer">That takes care of the tab, but we still need to save the background for when the tab is extended upward.  That&#8217;s as easy as saving a 1px high strip from the extended background like so:</p>
<p><img title="Cropping the image for only a single pixel line" src="http://ryanburrell.com/wp-content/uploads/2008/12/rss_widget6.jpg" alt="Cropping the image for only a single pixel line" width="411" height="159" /></p>
<p class="clearer">Note: the icons I&#8217;m using for the RSS links are adaptations from the Silk set found at <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">FamFamFam</a>.  I&#8217;ve modified these separately and uploaded them.</p>
<h2>Preparing The Box</h2>
<p>Now that we&#8217;ve cropped out the images we need and uploaded them, it&#8217;s time to look at some code.  As with the search box, it&#8217;s pretty basic.  The following is placed in the <code>sidebar.php</code> file for my WordPress theme, right above the code for the search section:</p>
<ol class="code">
<li><code>&lt;div id="rss"&gt;</code></li>
<li class="tab1"><code>&lt;a class="tab"&gt;RSS&lt;/a&gt;</code></li>
<li class="tab1"><code>&lt;div id="rss_feeds" class="clearfix"&gt;</code></li>
<li class="tab2"><code>&lt;a id="rss_comments" href="&lt;?php bloginfo('comments_rss2_url'); ?&gt;" title="Comments Feed"&gt;Comments&lt;/a&gt;</code></li>
<li class="tab2"><code>&lt;a id="rss_posts" href="&lt;?php bloginfo('rss2_url'); ?&gt;" title="RSS Feed"&gt;Posts&lt;/a&gt;</code></li>
<li class="tab1"><code>&lt;/div&gt;</code></li>
<li><code>&lt;/div&gt;</code></li>
</ol>
<p>Nothing scary there.  Just some organizational <code>&lt;div&gt;</code> tags and some WordPress function calls to specific RSS link locations (which can be found in their <a href="http://codex.wordpress.org/" target="_blank">Codex</a>).  I&#8217;m using the <code>&lt;a class="tab"&gt;RSS&lt;/a&gt;</code> tag to serve as the point of interaction where the reader will click to expand/contract the RSS section.  And now for the CSS wrapping paper:</p>
<ol class="code">
<li><code>/* RSS Feeds */</code></li>
<li><code>#rss {</code></li>
<li class="tab1"><code> background: url(../images/bkgrd_rss_top.png) no-repeat;</code></li>
<li class="tab1"><code> margin: 10px 0 0 0;</code></li>
<li><code>}</code></li>
<li><code>#rss a {</code></li>
<li class="tab1"><code> display: block;</code></li>
<li class="tab1"><code> padding: 0;</code></li>
<li><code>}</code></li>
<li><code>#rss .tab {</code></li>
<li class="tab1"><code> height: 20px;</code></li>
<li class="tab1"><code> margin: 0 0 0 119px;</code></li>
<li class="tab1"><code> width: 68px;</code></li>
<li><code>}</code></li>
<li><code>#rss #rss_feeds {</code></li>
<li class="tab1"><code> background: url(../images/bkgrd_rss.png) repeat-y;</code></li>
<li class="tab1"><code> display: none;</code></li>
<li class="tab1"><code> padding: 3px 10px 3px 6px;</code></li>
<li class="tab1"><code>}</code></li>
<li><code>#rss_feeds a {</code></li>
<li class="tab1"><code> float: right;</code></li>
<li class="tab1"><code> padding: 2px 20px 2px 0;</code></li>
<li><code>}</code></li>
<li><code>#rss_feeds #rss_posts {</code></li>
<li class="tab1"><code> background: url(../images/ico_rss_post.png) no-repeat center right;</code></li>
<li><code>}</code></li>
<li><code>#rss_feeds #rss_comments {</code></li>
<li class="tab1"><code> background: url(../images/ico_rss_comment.png) no-repeat center right;</code></li>
<li class="tab1"><code> margin: 0 0 0 14px;</code></li>
<li><code>}</code></li>
</ol>
<p>Nothing too fancy, but a brief explanation will help:</p>
<ul>
<li><code>#rss</code> produces the background image of the tab, telling it not to repeat.  This will sit behind the <code>&lt;a class="tab"&gt;RSS&lt;/a&gt;</code>.</li>
<li><code>#rss a</code> forces all <code>&lt;a&gt;</code> tags to display in block format, which allows margin and padding properties to be applied to them.</li>
<li><code>#rss .tab</code> sets the <code>&lt;a class="tab"&gt;RSS&lt;/a&gt;</code> to have a height matching the height of the tab background.  It also sets a margin and width, making it act as a box over the tab on the right side, instead of a block clickable area across the top of the entire RSS section.</li>
<li><code>#rss #rss_feeds</code> sets the 1px background to tile and fill in the space occupied by the RSS links.  We set it to hide by default with the display:none property.</li>
<li><code>#rss_feeds a</code> floats the RSS links, allowing them to still have block properties applied to them while displaying inline next to each other.</li>
<li><code>#rss_feeds #rss_posts</code> and <code>#rss_feeds #rss_comments</code> set the background icon images for the post and comments feed links, respectively.</li>
</ul>
<p>All that give us the finished visual product.  But how do we make it expand and collapse all nifty-like?</p>
<p>Enter jQuery</p>
<p>JQuery is a fantastic javascript library that makes visual effects extremely easy to achieve.  It also does a lot more, like AJAX, but we&#8217;re just using the visual portion for this.  Here&#8217;s what you need:</p>
<ul>
<li><a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.pack.js" target="_blank">jquery framework file</a></li>
<li><a href="http://jquery-ui.googlecode.com/files/jquery.ui-1.6rc2.zip" target="_blank">jquery UI core file</a></li>
</ul>
<p>You can <a href="http://ui.jquery.com/download_builder/" target="_blank">customize</a> the UI core file if you want to keep the filesize low.  All we&#8217;ll be working with is the Blind effect, so you can build your own UI JS file to include just that.  All I need do is link these files in the head section of my WordPress theme by writing:</p>
<ol class="code">
<li><code>&lt;script type="text/javascript" src="&lt;?php bloginfo('template_directory'); ?&gt;/js/jquery-1.2.6.js"&gt;&lt;/script&gt;</code></li>
<li><code>&lt;script type="text/javascript" src="&lt;?php bloginfo('template_directory'); ?&gt;/js/jquery-ui-1.5.2.js"&gt;&lt;/script&gt;</code></li>
</ol>
<p>Now, I&#8217;ve made a separate JS file called <code>functions.js</code> where I store all my global javascript functions that are used throughout the site.  I&#8217;ve linked this in the theme and I&#8217;ll take the following code and place it in there:</p>
<ol class="code">
<li><code>$(document).ready(function() {</code></li>
<li class="tab1"><code>//Function to hide/show RSS feeds tab and disable button unless JS is active</code></li>
<li class="tab1"><code>$('#rss_feeds').hide();</code></li>
<li class="tab2"><code>$('a.tab').click(function(){</code></li>
<li class="tab2"><code>$('#rss_feeds').toggle("blind", { direction: "vertical" }, 250);</code></li>
<li class="tab1"><code>});</code></li>
<li><code>});</code></li>
</ol>
<p>In English this means that once the document is ready (<code>$(document).ready(function()</code>), make sure that the <code>&lt;div id="rss_feeds"&gt;</code> is hidden.  Once that&#8217;s done, setup a function so that when the <code>&lt;a class="tab"&gt;</code> is clicked, jQuery will toggle the <code>&lt;div id="rss_feeds"&gt;</code> using the Blind visual effect of the jQuery UI.</p>
<p>That&#8217;s really it.  It&#8217;s not very complicated at all, and it adds a nice little visual effect.  The best part is, should javascript be disabled, the RSS tab will default to being open so that the reader doesn&#8217;t miss out on the easy access to the RSS links.</p>
<p>In the future, I&#8217;ll look for more little things that can be done to tidy up a site and add an extra little personality to it.  Except to read about them here when I do.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanburrell.com/2008/12/the-making-of-a-not-so-boring-searchrss-widget-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Making of a Not-So-Boring Search/RSS Widget</title>
		<link>http://ryanburrell.com/2008/11/the-making-of-a-not-so-boring-searchrss-widget/</link>
		<comments>http://ryanburrell.com/2008/11/the-making-of-a-not-so-boring-searchrss-widget/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 14:00:10 +0000</pubDate>
		<dc:creator>Ryan Burrell</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[theme modification]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.ryanburrell.com/?p=85</guid>
		<description><![CDATA[Maintaining your own site can be a real chore.  That&#8217;s one of the many reasons why I like WordPress so much: it makes updating and adding new content easy. But what about non-content updates?  I&#8217;m talking about tweaking something that doesn&#8217;t look exactly the way you&#8217;d like it to visually.  A lot of people seem&#8230;]]></description>
			<content:encoded><![CDATA[<p><img title="Before &amp; After" src="http://www.ryanburrell.com/wp-content/uploads/2008/11/search_widget.jpg" alt="Before &amp; after of the search widget for ryanburrell.com" width="530" height="250" /></p>
<p>Maintaining your own site can be a real chore.  That&#8217;s one of the many reasons why I like WordPress so much: it makes updating and adding new content easy.</p>
<p>But what about non-content updates?  I&#8217;m talking about tweaking something that doesn&#8217;t look exactly the way you&#8217;d like it to visually.  A lot of people seem to shy away from this because it seems very daunting.  That&#8217;s yet another reason why I love the general setup of WordPress: changing the visual composition is just as easy as changing the content.</p>
<p>Note: from this point on I&#8217;m going to assume the reader&#8217;s at least beginner knowledge of Photoshop, CSS, and HTML.</p>
<h2>The Goal</h2>
<p>As you can tell from the header picture above, the search section in the sidebar of this site was pretty lacking for awhile.  It <em>worked</em> fine, but looked like crap (which in my book is just as important as making sure it works).  So, I set out to give it facelift.</p>
<p>But where to begin?  Probably the most daunting part of making a visual change to any part of a site is the fact that it involves being *GASP* creative.  It&#8217;s really not that hard; give yourself some credit: you&#8217;re more creative than you think.  In my case, I&#8217;ve decided to go with this whole mixed-media jump-off-the-page approach because I feel it is more engaging to the viewer and keeps me from being entirely bored after staring at it for hours trying to get something to work right in <a href="http://www.stopie6.org/" target="_blank">IE6</a>.  So, I decided I need to do something that goes along with that.  Enter the torn paper look.</p>
<h2>Texturize Me!</h2>
<p>Awhile back I found this <a href="http://www.smashingmagazine.com/2008/11/10/50-must-have-photoshop-brushes/" target="_blank">great post on Smashing Magazine</a>.  I think I downloaded almost every brush they had listed, but in particular I was intrigued by the torn paper brushes.  I selected one that looked like a scrap of paper, and smacked it over my original layout file in Photoshop. <img title="The brush I selected" src="http://www.ryanburrell.com/wp-content/uploads/2008/11/search_widget2.jpg" alt="The brush I selected" width="390" height="277" /></p>
<p class="clearer">I added a little bit of emboss to make it pop, and called it good.  Nothing super fancy, but enough to make it interesting.</p>
<p><img title="Paper scrap in my layout" src="http://www.ryanburrell.com/wp-content/uploads/2008/11/search_widget4.jpg" alt="Paper scrap in my layout" width="301" height="191" /></p>
<p class="clearer">Now, the bigger issue is scalability.  Since whatever I end up putting in this search area could potentially increase with the browser&#8217;s text size, I need to make sure that it grows.  So, what is now a single image will become two, and the bottom portion will have a transparent background so it can move down the page and still have the page background show through.  Let&#8217;s look at the code:</p>
<ol class="code">
<li><code>&lt;form method="get" id="searchform" action="&lt;?php bloginfo('url'); ?&gt;/"&gt;</code></li>
<li class="tab1"><code>&lt;div&gt;</code></li>
<li class="tab2"><code>&lt;label class="nodisplay" for="s"&gt;&lt;?php _e('search for:'); ?&gt;&lt;/label&gt;</code></li>
<li class="tab2"><code>&lt;input type="text" value="&lt;?php the_search_query(); ?&gt;" name="s" id="s" /&gt;</code></li>
<li class="tab2"><code>&lt;div class="right"&gt;</code></li>
<li class="tab3"><code>&lt;input type="image" src="&lt;?php bloginfo('template_directory'); ?&gt;/images/btn_search.gif" id="searchsubmit" value="search" /&gt;</code></li>
<li class="tab2"><code>&lt;/div&gt;</code></li>
<li class="tab1"><code>&lt;/div&gt;</code></li>
<li class="tab1"><code>&lt;div class="btm"&gt;&lt;/div&gt;</code></li>
<li><code>&lt;/form&gt;</code></li>
</ol>
<p>Now, I made my theme from the Default Theme that&#8217;s included with WordPress, so the above code is located in the <code>searchform.php</code> template page.  All themes are different, so yours may be somewhere else entirely.  The idea here is that the background portion that is more solid will be its own image that will tile, while the bottom part with the ragged edge will be a single, non-tiling image.  To accommodate this, all of the actual content of the search form (the <code>&lt;label&gt;</code> <code>&lt;input type="text"&gt;</code> and the <code>&lt;input type="image"&gt;</code>) is contained within its own <code>&lt;div&gt;</code> that will have the tiling background.  A separate <code>&lt;div&gt;</code> (the one with the <code>class="btm"</code>) is placed just below that, which will be styled to show just the ragged edge.</p>
<p>Next up, saving the images and writing the CSS.</p>
<h2>Enter Photoshop</h2>
<p>Photoshop is great.  Saving the first background image (the one that will tile) is easy.  The image is cropped to only have the solid portion, click the Save For Web option in the menu, and you&#8217;re done.</p>
<p><img title="Cropping the image" src="http://ryanburrell.com/wp-content/uploads/2008/11/search_widget5.jpg" alt="Cropping the image" width="301" height="191" /></p>
<p class="clearer">The ragged portion at the bottom is a little trickier.  We want the ragged edge to be able to move down the page as this search widget area lengthens.  If we simply cropped the image with the page background behind it, then when it moved it would eventually show the crop line.  Nope, instead we&#8217;re going to erase around the ragged edge of the image to make it transparent, and then save it as a GIF.  Don&#8217;t worry about being too exact; a surprisingly large amount of visual effects on the web rely on your eye automatically blending like-colored and blurred areas together on screen and other visual tricks:</p>
<p class="clearer"><img title="Making the bottom transparent" src="http://www.ryanburrell.com/wp-content/uploads/2008/11/search_widget3.jpg" alt="Making the bottom transparent" width="452" height="192" /></p>
<h2 class="clearer">The CSS</h2>
<p>Now that the images have been cropped, edited, saved, and uploaded correctly, we&#8217;ll write in some simple CSS to make everything come together.  The following is entered into the stlyesheet I have connected to my site that defines the visual composition:</p>
<ol class="code">
<li><code>/* Search Form */</code></li>
<li><code>#searchform div {</code></li>
<li class="tab1"><code>background: url(../images/bkgrd_search.jpg) repeat-y;</code></li>
<li class="tab1"><code>padding: 0 12px 0 7px;</code></li>
<li><code>}</code></li>
<li><code>#searchform div.right {</code></li>
<li class="tab1"><code>background: none;</code></li>
<li class="tab1"><code>padding: 0;</code></li>
<li><code>}</code></li>
<li><code>#searchform div.btm {</code></li>
<li class="tab1"><code>background: url(../images/bkgrd_search_btm.gif) no-repeat;</code></li>
<li class="tab1"><code>height: 18px;</code></li>
<li><code>}</code></li>
<li><code>#searchform input#s {</code></li>
<li class="tab1"><code>border: solid 1px #A5ACB2;</code></li>
<li class="tab1"><code>margin: 12px 0 6px 0;</code></li>
<li class="tab1"><code>width: 100%;</code></li>
<li><code>}</code></li>
</ol>
<p>I quick run-through on what the code is doing here.</p>
<ul>
<li><code>#searchform div</code> assigns the background to the <code>&lt;div&gt;</code> containing all the form elements, tiling by default.  Since this is assigned to all <code>&lt;div&gt;</code> tags within the <code>&lt;form&gt;</code>, we need:</li>
<li><code>#searchform div.right</code>.  This excludes the <code>&lt;div&gt;</code> that aligns the search button to the right from tiling the background image again.</li>
<li><code>#searchform div.btm</code> edits the &#8220;empty&#8221; <code>&lt;div class="btm"&gt;</code>.  It tells it to have the ragged edge as a background, to not tile, and to be the exact height of the image.  This is important, because otherwise the <code>&lt;div&gt;</code> would collapse since it contains nothing inside it.</li>
<li><code><code>#searchform input#s</code> just contains some simple styling for the search box.</code></li>
</ul>
<p>That&#8217;s it; we&#8217;re done!</p>
<h2>Going Further</h2>
<p>Next time up: the RSS portion.  It&#8217;s a bit more complicated, but luckily it involes <a href="http://jquery.com/" target="_blank">jQuery</a>, which makes it extremely easy.  Until then&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanburrell.com/2008/11/the-making-of-a-not-so-boring-searchrss-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

