<?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>Outstando</title>
	<atom:link href="http://outstando.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://outstando.com</link>
	<description>Awesome HTML, CSS, jQuery &#38; WordPress theme Tips &#38; Services</description>
	<lastBuildDate>Mon, 10 Oct 2011 14:09:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Limited Fixed Area Using jQuery</title>
		<link>http://outstando.com/limited-fixed-area-using-jquery/</link>
		<comments>http://outstando.com/limited-fixed-area-using-jquery/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 14:09:07 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Fixed]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Positioning]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=376</guid>
		<description><![CDATA[Have you seen or used Thoughtplifier theme? If you notice, there is this &#8220;limited fixed sidebar&#8220;. Basically it&#8217;s an element which is positioned using the position: relative absolute combo and its top CSS property is dynamically modified using jQuery so it can be set to be stopped when the window is scrolled to particular area. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-378" title="Limited Fixed Area" src="http://outstando.com/wp-content/uploads/2011/10/Limited-Fixed-Area.png" alt="Limited Fixed Area" width="480" height="360" /></p>
<p>Have you seen or used <a title="Thoughtplifier Theme" href="http://outstando.com/thoughtplifier/" target="_blank">Thoughtplifier theme</a>? If you notice, there is this &#8220;<em>limited fixed sidebar</em>&#8220;. Basically it&#8217;s an element which is positioned using the <a title="Kombinasi Relative + Absolute Positioning" href="http://outstando.com/kombinasi-relative-absolute-positioning/" target="_blank"><code>position: relative absolute combo</code></a> and its top CSS property is dynamically modified using jQuery so it can be set to be stopped when the window is scrolled to particular area.</p>
<p><span id="more-376"></span></p>
<p>To create this functionality, here are what you need:</p>
<ol>
<li><code><a title="jQuery .scroll()" href="http://api.jquery.com/scroll/" target="_blank">.scroll()</a></code> : trigger an action when the window is scrolled</li>
<li><code><a title="jQuery .scrollTop()" href="http://api.jquery.com/scrollTop/" target="_blank">.scrollTop()</a></code> : get the margin-top of current scrolled window toward the top side of the document</li>
<li><code><a title="jQuery .offset()" href="http://api.jquery.com/offset/" target="_blank">.offset()</a></code> : get the margin-top or margin-left of particular element toward the document</li>
<li><code><a title="jQuery .height()" href="api.jquery.com/height/" target="_blank">.height()</a></code> : get the height of particular element</li>
</ol>
<p>Combine those APIs to work on this logic. When the window is scrolled:</p>
<ol>
<li>If the window position is in between top limit and bottom limit (let&#8217;s say the you want this limited fixed area should only move beside article area and stopped when the window is scrolled to comment area), <a title="Understanding jQuery’s .animate() API" href="http://outstando.com/understanding-jquerys-animate-api/" target="_blank">animate</a> it in relative manner toward the position of the top window.</li>
<li>If the window position has reached bottom limit, stop the fixed limit area above the bottom limit</li>
<li>If the window isn&#8217;t in between top limit and bottom limit NOR reached bottom limit which means that it is scrolled to the top, re-positioned it to its original state.</li>
</ol>
<p>Here&#8217;s the jQuery functionality created based the logic above:</p>
<pre class="brush:javascript">If the window is scrolled:
$(window).scroll(function(){
// place the action here
});</pre>
<p>The if conditional logic:</p>
<pre class="brush:javascript">$(window).scroll(function(){
if ( ){
/* Check if the current window position is below the #article AND above the #content */
} else if (){
/* If the current window position is below the #comment, stop it on the top of #comment. */
} else {
/* If it isn't below the #content or in between #article and #comment,
it means that the window is scrolled to the top. Set the value to zero
to place the #box on its original position. */
}
});</pre>
<p>And here&#8217;s the complete code:</p>
<pre class="brush:javascript">$(document).ready(function() {
var starting_position = $('#box').offset();
var top_padding = 10;
var bottom_limit = $('#comment').offset();
var box_height = $('#box').height() + 20;

$(window).scroll(function(){
var top_window = $(window).scrollTop();

if (top_window &gt; starting_position.top &amp;&amp; top_window &lt; bottom_limit.top - box_height){
$('#box').stop().animate({top: top_window - starting_position.top + top_padding}, 400);
} else if (top_window &gt; bottom_limit.top - starting_position.top - box_height){
$('#box').stop().animate({top: bottom_limit.top - starting_position.top - box_height }, 400);
} else {
$('#box').stop().animate({top: 0 }, 400);
}
});
});</pre>
<p>I&#8217;d recommend you to check out the demo page and view its source code to understand it more. I&#8217;ve added couple of comment lines to make it more understandable:</p>
<p><a class="button" title="Limited Fixed Area demo" href="http://outstando.com/demo/limited-fixed-area.html" target="_blank">Limited Fixed Area Using jQuery Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/limited-fixed-area-using-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Understanding jQuery&#8217;s .animate() API</title>
		<link>http://outstando.com/understanding-jquerys-animate-api/</link>
		<comments>http://outstando.com/understanding-jquerys-animate-api/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 04:02:42 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Basic Concept]]></category>
		<category><![CDATA[.animate()]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery API]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=359</guid>
		<description><![CDATA[There are lots of handy jQuery APIs, but in my opinion, one of the jQuery fanciest API is .animate(). We can simply say that animate is about transitioning any CSS property you want. Let&#8217;s say you have this 100 X 100 pixels box and you want to change its size to 150 X 150 pixels [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-254" title="jQuery Main" src="http://outstando.com/wp-content/uploads/2011/02/Screen-shot-2011-04-03-at-8.20.29-PM.png" alt="jQuery Image" width="480" height="360" /></p>
<p>There are lots of <a title="jQuery API" href="http://api.jquery.com" target="_blank">handy jQuery APIs</a>, but in my opinion, one of the jQuery fanciest API is <a title="jQuery API: animate" href="http://api.jquery.com/animate/" target="_blank">.animate()</a>. We can simply say that animate is about <strong>transitioning any CSS property you want</strong>. Let&#8217;s say you have this 100 X 100 pixels box and you want to change its size to 150 X 150 pixels once user clicks it. This is the &#8216;plain way&#8217; of doing it:</p>
<p><span id="more-359"></span></p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/fikrirasyid/3JZ7Y/embedded/" width="320" height="240"></iframe></p>
<p>While it gets the stuff done, compare the way its size is changing by using <a title="jQuery API: animate" href="http://api.jquery.com/animate/" target="_blank">.animate()</a>:</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/fikrirasyid/5mqN2/embedded/" width="320" height="240"></iframe></p>
<p>Prettier, isn&#8217;t it? That&#8217;s what .animate does: it changes css properties (dimension, color, opacity, display, background color, you name it). However, rather than &#8216;jumping&#8217; the values of the properties, <strong>it changes the CSS properties you stated by transitioning it from the current values to desired values, one step at time, which makes it looks animated</strong>. Hey, the name of the API is animate(), right? <img src='http://outstando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/understanding-jquerys-animate-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tables Involved in WordPress Menu Feature</title>
		<link>http://outstando.com/tables-involved-in-wordpress-menu-feature/</link>
		<comments>http://outstando.com/tables-involved-in-wordpress-menu-feature/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 08:11:43 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Menus]]></category>
		<category><![CDATA[PhpMyAdmin]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=347</guid>
		<description><![CDATA[Lately one of the project i&#8217;m involved in is having this weird issue which unable to save the whole menu items we made (The menu item saving process is suddenly ended after 80-something menu items are saved). Okay, it is idea of mine to use mega dropdown menu but i didn&#8217;t expect that it is [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-348" title="WordPress Menu Builder" src="http://outstando.com/wp-content/uploads/2011/10/WordPress-Menu-Builder.png" alt="WordPress Menu Builder" width="480" height="360" /></p>
<p>Lately one of the project i&#8217;m involved in is having this weird issue which unable to save the whole menu items we made (The menu item saving process is suddenly ended after 80-something menu items are saved). Okay, it is idea of mine to use mega dropdown menu but i didn&#8217;t expect that it is going to have hundreds of menu item on it LOL Weirdly, it works well on local and development server. Considering this issue i think the problem is not the incapability of WordPress in handling hundreds of menu-item. I (currently) believe that the problem is on the server configuration which we&#8217;re still working on it.</p>
<p><span id="more-347"></span></p>
<p>However, there is a requirement to add more menu item. Since it is currently unable to save more menu-item through dashboard interface, i decided to figure out how WordPress menu works and insert the menu item directly through the database (i&#8217;m using PhpMyAdmin) while we&#8217;re working on the server configuration issue. After some couple of times messing with the database, i finally get how it works.</p>
<p>If you&#8217;re about to &#8216;<em>directly insert</em>&#8216; a menu-item to existing menu location, there are three tables that you&#8217;re going to modify: <code>wp_posts</code>, <code>wp_term_relationships</code> and <code>wp_postmeta</code>. However, if you&#8217;re going to see it on its bigger picture, <code>wp_terms</code> and <code>wp_term_taxonomy</code> is also involved in this.</p>
<p>Let&#8217;s say I&#8217;m going to add a custom menu item with &#8220;<code>@fikrirasyid</code>&#8221; as its label and a link to my twitter profile &#8220;<a title="Fikri Rasyid on Twitter" href="http://twitter.com/fikrirasyid" target="_blank">http://twitter.com/fikrirasyid</a>&#8221; as its URL.</p>
<h2>1. Insert new record to <code>wp_posts</code> table</h2>
<div id="attachment_349" class="wp-caption alignnone" style="width: 490px"><a href="http://outstando.com/wp-content/uploads/2011/10/wp_posts.png"><img class="size-medium wp-image-349" title="wp_posts" src="http://outstando.com/wp-content/uploads/2011/10/wp_posts-480x27.png" alt="wp_posts" width="480" height="27" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<p>These are some fields you have to pay attention to:</p>
<ul>
<li><code>ID</code> : The ID of the item</li>
<li><code>post_title</code> : Information that will be used as &#8220;label&#8221; of the menu-item</li>
<li><code>post_status</code> : make sure it&#8217;s &#8220;publish&#8221;</li>
<li><code>post_name</code> : Information that will be used as its slug</li>
<li><code>menu_order</code> : information that is used to determine the order of the menu-item.</li>
<li><code>post_type</code> : Make sure that it&#8217;s &#8220;nav_menu_item&#8221;</li>
</ul>
<h2>2. Insert new record to <code>wp_term_relationships</code></h2>
<div id="attachment_350" class="wp-caption alignnone" style="width: 490px"><a href="http://outstando.com/wp-content/uploads/2011/10/wp_term_relationships.png"><img class="size-medium wp-image-350" title="wp_term_relationships" src="http://outstando.com/wp-content/uploads/2011/10/wp_term_relationships-480x57.png" alt="wp_term_relationships" width="480" height="57" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<p>for more understanding toward <code>wp_term_relationships</code>&#8216; <code>term_taxonomy_id</code> field, take a look at <code>wp_terms</code> and <code>wp_term_taxonomy</code> tables below.</p>
<div id="attachment_351" class="wp-caption alignnone" style="width: 490px"><a href="http://outstando.com/wp-content/uploads/2011/10/wp_term_taxonomy.png"><img class="size-medium wp-image-351" title="wp_term_taxonomy" src="http://outstando.com/wp-content/uploads/2011/10/wp_term_taxonomy-480x87.png" alt="wp_term_taxonomy" width="480" height="87" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<div id="attachment_352" class="wp-caption alignnone" style="width: 490px"><a href="http://outstando.com/wp-content/uploads/2011/10/wp_terms.png"><img class="size-medium wp-image-352" title="wp_terms" src="http://outstando.com/wp-content/uploads/2011/10/wp_terms-480x70.png" alt="wp_terms" width="480" height="70" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<h2>3. Insert 8 new records to <code>wp_postmeta</code></h2>
<p>Finally here&#8217;s the last recipe. These 8 records on the <code>wp_postmeta</code> are where the values of menu-item is stored.</p>
<div id="attachment_353" class="wp-caption alignnone" style="width: 490px"><a href="http://outstando.com/wp-content/uploads/2011/10/wp_postmeta.png"><img class="size-medium wp-image-353" title="wp_postmeta" src="http://outstando.com/wp-content/uploads/2011/10/wp_postmeta-480x155.png" alt="wp_postmeta" width="480" height="155" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<div id="attachment_354" class="wp-caption alignnone" style="width: 490px"><a href="http://outstando.com/wp-content/uploads/2011/10/Menu-item-fields.png"><img class="size-medium wp-image-354" title="Menu-item fields" src="http://outstando.com/wp-content/uploads/2011/10/Menu-item-fields-480x266.png" alt="Menu-item fields" width="480" height="266" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<p>Anyway, there is further note you need to know for these <code>meta_key</code>s:</p>
<ul>
<li><code>_menu_item_object</code> : there is custom, pages, categories, custom taxonomies, and so on and so forth.</li>
<li><code>_menu_item_object_id</code> : If the type of menu-item is page, then this <code>meta_key</code> will store the value of page <code>ID</code> (note that it&#8217;s page <code>ID</code> on <code>wp_posts</code>, not the <code>nav_menu_item</code> <code>ID</code> version of it)</li>
<li><code>_menu_item_menu_item_parent</code> : the <code>ID</code> of parent menu item</li>
</ul>
<p>And that&#8217;s it. To comprehend it more, it&#8217;ll be a good idea to take a look to your existing local WordPress site&#8217;s database and understand it in your own situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/tables-involved-in-wordpress-menu-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Do-It-Yourself Modal Box</title>
		<link>http://outstando.com/simple-do-it-yourself-modal-box/</link>
		<comments>http://outstando.com/simple-do-it-yourself-modal-box/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 04:00:54 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Do It Yourself]]></category>
		<category><![CDATA[Modal Box]]></category>
		<category><![CDATA[Simple]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=339</guid>
		<description><![CDATA[Here&#8217;s a simple truth about modal box: It is ridiculously easy to be made. The Logic Basically, modal box is a &#8216;flying&#8217; box on top of another content. To achieve this kind of state, all you need is: Create a wrapper which is positioned on top of everything. Utilize the usage of position:fixed, 100% width [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-340" title="Modal Box in action" src="http://outstando.com/wp-content/uploads/2011/09/Modal-Box-in-action.png" alt="Modal Box in action" width="480" height="332" /></p>
<p>Here&#8217;s a simple truth about modal box:<strong> It is ridiculously easy to be made.</strong><span id="more-339"></span></p>
<h2>The Logic</h2>
<p>Basically, modal box is a &#8216;flying&#8217; box on top of another content. To achieve this kind of state, all you need is:</p>
<ol>
<li>Create a wrapper which is positioned on top of everything. Utilize the usage of <code>position:fixed</code>, 100% <code>width</code> &amp; <code>height</code>, <code>top</code> &amp; <code>left</code> and <code>z-index</code> (if it is needed)</li>
<li>Create the &#8216;box&#8217; inside the wrapper. Place your content within it. Utilize the usage of <code>margin: auto</code> to adjust its position</li>
<li>You want to show it only if user click particular link, right? great, now <code>display:none</code> it.</li>
<li>Using javascript (i&#8217;m using jQuery), show the wrapper if particular DOM is clicked.</li>
<li>The modal box need to be hidden after its content is read. Using javascript, create a functionality which makes the wrapper hidden if particular DOM is clicked.</li>
</ol>
<h2>The HTML Markup</h2>
<p><img class="alignnone size-full wp-image-341" title="Modal Box HTML Structure" src="http://outstando.com/wp-content/uploads/2011/09/Modal-Box-HTML-Structure.png" alt="Modal Box HTML Structure" width="480" height="346" /></p>
<p>Place this code anywhere you want. I&#8217;d rather place it on the bottom of the page, though.</p>
<pre class="brush:html">&lt;div id="modal-background"&gt;
&lt;div id="modal-box"&gt;
&lt;h2&gt;This is the modalbox&lt;/h2&gt;
&lt;p&gt;Paragraph Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
&lt;a href="#" id="close-modal"&gt;Close this modal box&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<h2>The CSS</h2>
<p>The trick: style it on modal-box-is-shown state first. If the styling has been okay, <code>display:none</code> it.</p>
<pre class="brush:css">#modal-background      {position:fixed; left:0; top:0; width:100%; height:100%; background:rgba(0,0,0,0.8); display:none;}
#modal-box          {display:block; background:#fff; width:400px; padding:20px; margin:100px auto; box-shadow:0 0 10px #efefef;}
#modal-box h2          {margin-top:0;}</pre>
<h2>The JavaScript, using jQuery</h2>
<p>Use the beauty of jQuery&#8217;s <a title="jQuery API: fadeIn()" href="http://api.jquery.com/fadeIn/" target="_blank">fadeIn()</a> and<a title="jQuery API: fadeOut" href="http://api.jquery.com/fadeOut/" target="_blank"> fadeOut()</a> in setting display:block and display:none a DOM.</p>
<pre class="brush:javascript">$(document).ready(function() {
$('#show-modal').click(function(){
$('#modal-background').fadeIn();
return false;
});

$('#close-modal').click(function(){
$('#modal-background').fadeOut();
return false;
});
});</pre>
<h2>The Demo</h2>
<p>And that&#8217;s that. Here&#8217;s the demo:</p>
<p><a class="button" title="Demo of Simple Do-It-Yourself Modal Box" href="http://outstando.com/demo/modal-box.html" target="_blank">Demo of Simple Do-It-Yourself Modal Box</a></p>
<p>As usual, please take a look at its page source code for further explanation. Hope it helps <img src='http://outstando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/simple-do-it-yourself-modal-box/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dead Simple Do-It-Yourself Tabbed Area Using jQuery</title>
		<link>http://outstando.com/dead-simple-do-it-yourself-tabbed-area-using-jquery/</link>
		<comments>http://outstando.com/dead-simple-do-it-yourself-tabbed-area-using-jquery/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 03:51:08 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Basic]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tab]]></category>
		<category><![CDATA[Tabbed Area]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=333</guid>
		<description><![CDATA[Why do we have to learn how to code tabbed area while there are so many plugins that able to create a tabbed area instantly? Why do we have to reinvent the wheel? Because understanding how it works is a good plus for you. If you understand the way it works, you may customize it [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-336" title="Tabbed Area" src="http://outstando.com/wp-content/uploads/2011/09/Tabbed-Area.png" alt="Tabbed Area" width="480" height="360" /></p>
<p>Why do we have to learn how to code tabbed area while there are so many plugins that able to create a tabbed area instantly? Why do we have to reinvent the wheel?</p>
<p>Because understanding how it works is a good plus for you. If you understand the way it works, you may customize it for your further need. Plus, it&#8217;s a damn easy.</p>
<p><span id="more-333"></span></p>
<p>So let&#8217;s get going</p>
<h2>The Markup</h2>
<p>Basically, this is the common structure of a tabbed area:</p>
<p><a href="http://outstando.com/wp-content/uploads/2011/09/HTML-Structure-of-Tabbed-Area.jpg"><img class="alignnone size-medium wp-image-334" title="HTML Structure of Tabbed Area" src="http://outstando.com/wp-content/uploads/2011/09/HTML-Structure-of-Tabbed-Area-480x319.jpg" alt="HTML Structure of Tabbed Area" width="480" height="319" /></a></p>
<p><em>Click picture to enlarge</em></p>
<p>A wrapper contains a tab navigation which is built on unorder-lists plus a link inside and a tab content which contains several div areas.</p>
<p>Here&#8217;s the code:</p>
<pre class="brush:html">&lt;h1&gt;Dead Simple &lt;em&gt;Do-It-Yourself&lt;/em&gt; Tabbed Area&lt;/h1&gt;
&lt;div id="tab-wrap" class="clearfix"&gt;

&lt;ul id="tab-nav"&gt;
&lt;li&gt;&lt;a href="#first-tab"&gt;First Tab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#second-tab"&gt;Second Tab&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div id="tab-content"&gt;
&lt;div class="tab" id="first-tab"&gt;
&lt;h2&gt;This is first tab&lt;/h2&gt;
&lt;p&gt;This is first tab. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
&lt;p&gt;Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
&lt;p&gt;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&lt;/p&gt;
&lt;p&gt;Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
&lt;/div&gt;

&lt;div class="tab" id="second-tab"&gt;
&lt;h2&gt;This is second tab&lt;/h2&gt;
&lt;p&gt;This is second tab. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
&lt;p&gt;Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
&lt;p&gt;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&lt;/p&gt;
&lt;p&gt;Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;</pre>
<h2>The Logic</h2>
<p><img class="alignnone size-full wp-image-335" title="Tabbed Area Logic" src="http://outstando.com/wp-content/uploads/2011/09/Tabbed-Area-Logic.png" alt="Tabbed Area Logic" width="480" height="334" /></p>
<p>This is how the tab -commonly- works.</p>
<h3>Stylesheet</h3>
<ol>
<li>Style the markup so it looks like a tab</li>
<li>Hide all tabs &#8211; using stylesheet</li>
</ol>
<h3>Javascript initialization on page load</h3>
<ol>
<li>Show first tab &#8211; using javascript</li>
<li>Give specific class to first link on tab navigation to indicate that it is the active tab nav item &#8211; using javascript</li>
</ol>
<h3>When the tab nav item is clicked (Behaviour)</h3>
<p><strong>Important: href attribute of the tab-navigation link is pointed to specific tab ID. So when the tab-navigation item is clicked:</strong></p>
<ol>
<li>Get the value of <code>href</code> attribute of the clicked link</li>
<li>Hide all tab area</li>
<li>Show element with that value (which is an <code>ID</code> of one tab area)</li>
<li>remove all class which indicates active behavior from tab-navigation link</li>
<li>Add class to clicked tab-navigation link</li>
<li>Prevent link from behaving default action which is moving browser page to the assigned ID</li>
</ol>
<p>That&#8217;s the logic.</p>
<h2>The codes</h2>
<h3>The Stylesheet. Pretty self explanatory</h3>
<pre class="brush:css">/* Basic Styling */
#tab-wrap {display:block; width:300px; background:#efefef; padding:10px; margin-top:40px;}

/* Tab Navigation */
#tab-nav li {float:left;} /* floated. If this area isn't floated, it will be collapsed */
#tab-nav a {float:left; padding:5px 5px 2px; width:140px; background:#efefef;}
#tab-nav a.active{background:#fff;}

/* The Tab */
.tab {background:#fff; padding:10px; float:left; width:280px; display:none;}</pre>
<h3>The Javascript (using jQuery)</h3>
<pre class="brush:javascript">$(document).ready(function() {
$('.tab:first').show();
$('#tab-nav a:first').addClass('active');
$('#tab-nav a').click(function(){
var tabID = $(this).attr('href'); // Get the value of clicked a's href attribute
$('.tab').hide(); // Hide all tab
$(tabID).fadeIn(); // Show aimed tab
$('#tab-nav a').removeClass('active'); // Remove 'active' class from all nav item
$(this).addClass('active'); // Add 'active' class to clicked nav item
return false; // Kill the link, don't do default action which is 'jump' to destined ID
});
});</pre>
<h2>The Demo</h2>
<p>Finally here&#8217;s the demo:</p>
<p><a title="Demo of Dead Simple DIY Tabbed Area Using jQuery" href="http://outstando.com/demo/dead-simple-diy-tabbed-element.html" target="_blank" class="button"> Demo of Dead Simple DIY Tabbed Area Using jQuery</a></p>
<p>View the source code of the demo page for further explanation. Hope this tutorial helps <img src='http://outstando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/dead-simple-do-it-yourself-tabbed-area-using-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Thoughtplifier Version 0.2</title>
		<link>http://outstando.com/thoughtplifier-version-0-2/</link>
		<comments>http://outstando.com/thoughtplifier-version-0-2/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 12:23:52 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[Thoughtplifier]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[Version]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=318</guid>
		<description><![CDATA[After smashing some bugs and adding couple of features, finally i can say that Thoughtplifier, the theme which is used by my personal blog and Outstando (as in September 27th, 2011) has reached version 0.2. You can use this new version right away, just click the download button below and it is going to be [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-294" title="Thoughtplifier Front" src="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-Front.png" alt="" width="480" height="292" /></p>
<p>After smashing some bugs and adding couple of features, finally i can say that Thoughtplifier, the theme which is used by <a title="Fikri Rasyid - it's gonna be a thing" href="http://fikrirasyid.com" target="_blank">my personal blog</a> and Outstando (as in September 27th, 2011) has reached version 0.2. You can use this new version right away, just click the download button below and it is going to be downloaded directly from GitHub:</p>
<p><a title="Thoughtplifier on GitHub" href="https://github.com/fikrirasyid/thoughtplifier/zipball/master" target="_blank" class="button">Download Thoughtplifier 0.2</a><span id="more-318"></span></p>
<h2>Smashed bugs on version 0.2:</h2>
<ul>
<li>Fixing page-navigation style bug</li>
<li>Fixing author-box collapsing bug</li>
<li>Fixing wp-smiley margin bug</li>
<li>Removing unwanted <code>:focus</code> state</li>
<li>Updating Theme Options Framework to version 0.9</li>
<li>Heading&#8217;s text-transform adjustment</li>
<li>Fixing broken jQuery function in iOS browser</li>
</ul>
<h2>Added Features in version 0.2:</h2>
<h3>Seven custom fonts for headings using <a title="Google Webfonts" href="http://www.google.com/webfonts" target="_blank">Google Webfonts</a></h3>
<p><a href="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Select-Font.png"><img class="alignnone size-full wp-image-319" title="Thoughtplifier-Select-Font" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Select-Font.png" alt="Thoughtplifier Select Font" width="480" height="360" /></a></p>
<div id="attachment_320" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-320" title="Thoughtplifier-Pacifico" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Pacifico.png" alt="Thoughtplifier Pacifico" width="480" height="140" /><p class="wp-caption-text">Pacifico Font</p></div>
<div id="attachment_321" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-321" title="Thoughtplifier-Leckerli-One" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Leckerli-One.png" alt="Thoughtplifier Leckerli One" width="480" height="140" /><p class="wp-caption-text">Leckerli One Font</p></div>
<div id="attachment_322" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-322" title="Thoughtplifier-Kreon" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Kreon.png" alt="Thoughtplifier Kreon" width="480" height="140" /><p class="wp-caption-text">Kreon Font</p></div>
<div id="attachment_323" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-323" title="Thoughtplifier-Georgia" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Georgia.png" alt="Thoughtplifier Georgia" width="480" height="140" /><p class="wp-caption-text">Georgia Font</p></div>
<div id="attachment_324" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-324" title="Thoughtplifier-Copse" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Copse.png" alt="Thoughtplifier Copse" width="480" height="140" /><p class="wp-caption-text">Copse Font</p></div>
<div id="attachment_325" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-325" title="Thoughtplifier-Carter-One" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Carter-One.png" alt="Thoughtplifier Carter One" width="480" height="140" /><p class="wp-caption-text">Carter One Font</p></div>
<div id="attachment_326" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-326" title="Thoughtplifier-Banger" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Banger.png" alt="Thoughtplifier Banger" width="480" height="140" /><p class="wp-caption-text">Banger Font</p></div>
<div id="attachment_327" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-327" title="Thoughtplifier-Lobster" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Lobster.png" alt="Thoughtplifier Lobster" width="480" height="140" /><p class="wp-caption-text">Lobster Font</p></div>
<h3>Add custom script through theme options</h3>
<p><img class="alignnone size-full wp-image-328" title="Thoughtplifier Theme Options Add Custom Script" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Theme-Options-Add-Custom-Script.png" alt="Thoughtplifier Theme Options Add Custom Script" width="480" height="267" /></p>
<h3>Set link as button</h3>
<p>Just add <code>class="button"</code> to any link in content section, then voila! It turns into button-alike link</p>
<p><img class="alignnone size-full wp-image-329" title="Thoughtplifier Button" src="http://outstando.com/wp-content/uploads/2011/09/Thoughtplifier-Button.png" alt="Thoughtplifier Button" width="480" height="140" /></p>
<h2>The future of Thoughtplifier</h2>
<p>Like <a href="http://outstando.com/thoughtplifier/" title="Thoughtplifier Theme" target="_blank">what i&#8217;ve mentioned on the previous post</a>, you can participate to the development of Thoughtplifier Theme. <a title="Thoughtplifier on GitHub" href="https://github.com/fikrirasyid/thoughtplifier" target="_blank">It is hosted on GitHub</a> so you may fork it, contribute your code, report any bugs, suggest any features or opinion, etc. My personal goal for this theme is submitting it to <a title="WordPress Theme Directory" href="http://wordpress.org/extend/themes/" target="_blank">WordPress Theme Directory</a> as soon as it hits the version 1.0 (i hope it has become mature enough, though) - <em>I&#8217;ve received lots great things from WordPress community, I guess it&#8217;s the time for me to contribute to the community</em>.</p>
<p>So what are you waiting for? <strong>Download Thougtplifier version 0.2 now</strong>! <img src='http://outstando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a class="button" title="Download Thoughtplifier Theme" href="https://github.com/fikrirasyid/thoughtplifier/zipball/master" target="_blank">Download Thoughtplifier 0.2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/thoughtplifier-version-0-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Filling Form Field by Clicking Image Using jQuery&#8217;s .attr()</title>
		<link>http://outstando.com/filling-form-field-by-clicking-image-using-jquerys-attr/</link>
		<comments>http://outstando.com/filling-form-field-by-clicking-image-using-jquerys-attr/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 10:29:31 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[attr()]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[order]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=303</guid>
		<description><![CDATA[Someone asked me how did i make the kartunama.net&#8217;s shopping chart on its order page. To be honest, it&#8217;s just a simple form with lots of javascript functions to make it interactive. The basic principle of the form is the use of jQuery&#8217;s .attr(). Here&#8217;s how it works: It is basically a form Most of [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked me how did i make the <a title="Order Kartu Nama / Flashcard di Kartunama.net" href="http://kartunama.net/order/" target="_blank">kartunama.net&#8217;s shopping chart on its order page</a>. To be honest, it&#8217;s just a simple form with lots of javascript functions to make it interactive. The basic principle of the form is the use of <a title="jQuery attr()" href="http://api.jquery.com/attr/" target="_blank">jQuery&#8217;s .attr()</a>.</p>
<p><strong>Here&#8217;s how it works:</strong><span id="more-303"></span></p>
<ol>
<li>It is basically a form</li>
<li>Most of its fields are text field</li>
<li>To make it interactive, most of the text fields are hidden. Some fields are filled by click-the-image-or-text then insert the information attached to the object into the hidden text field</li>
<li>When you hit the order button, the hidden text field is sent along with the shown text field.</li>
</ol>
<p><a href="http://outstando.com/wp-content/uploads/2011/09/Screen-shot-2011-09-25-at-4.36.13-PM.png"><img class="alignnone size-full wp-image-304" title="Screen shot 2011-09-25 at 4.36.13 PM" src="http://outstando.com/wp-content/uploads/2011/09/Screen-shot-2011-09-25-at-4.36.13-PM.png" alt="" width="480" height="408" /></a></p>
<p><a href="http://outstando.com/wp-content/uploads/2011/09/Screen-shot-2011-09-25-at-4.36.58-PM.png"><img class="alignnone size-full wp-image-305" title="Screen shot 2011-09-25 at 4.36.58 PM" src="http://outstando.com/wp-content/uploads/2011/09/Screen-shot-2011-09-25-at-4.36.58-PM.png" alt="" width="480" height="404" /></a></p>
<p>Here&#8217;s the code to make the thing works:</p>
<h2>The HTML markup</h2>
<p>Optimize the use of image&#8217;s title attribute. Set a class for images that is intended to be the selector.</p>
<pre class="brush:html">&lt;img src="images/thumb-1.png" alt="image no.1" title="image no.1" /&gt;
&lt;img src="images/thumb-2.png" alt="image no.2" title="image no.2" /&gt;</pre>
<p>Assign an ID to the intended text field.</p>
<pre class="brush:html">&lt;input type="text" id="image-selected" value="" /&gt;</pre>
<p>Create a previewer DOM. Since the text-field will be hidden, we need something that will be used to show the user which image that they have been selected.</p>
<pre class="brush:html">&lt;h3 id="preview-word"&gt;&lt;span id="preview-selected-image"&gt;&lt;/span&gt; has selected.&lt;/h3&gt;</pre>
<h2>The JavaScript (jQuery)</h2>
<p>Here are what we&#8217;re going to do. if the image is clicked:</p>
<ol>
<li>get the value of clicked image&#8217;s title attribute</li>
<li>insert the clicked image title value to assigned text field.</li>
<li>insert the clicked image title to assigned DOM which is built for previewing purpose.</li>
<li>the preview text is hidden by default, show it.</li>
</ol>
<p>For usability purpose, it&#8217;s a good idea to make selected item different from the unselected else. It reduces confusion. So:</p>
<ol>
<li>Change all image background to its default background color</li>
<li>Change the clicked image background color to particular background color</li>
</ol>
<p>Here&#8217;s to code:</p>
<pre class="brush:javascript">$('.selector').click(function(){

// this is where the trick happens
var data = $(this).attr('title');
$('#image-selected').attr('value', data);
$('#preview-selected-image').text(data);
$('#preview-word').show();

// for decorative and usability purpose
$('.selector').css('background-color', 'white');
$(this).css('background-color', '#960000');
});</pre>
<p>To make it clearer, here&#8217;s view the demo page of this tutorial. View the page source to view it in action:</p>
<p><a class="button" title="Filling Form Field by Clicking Image demo" href="http://outstando.com/demo/FillFormUsingImage.html" target="_blank">View the demo.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/filling-form-field-by-clicking-image-using-jquerys-attr/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Thoughtplifier Theme</title>
		<link>http://outstando.com/thoughtplifier/</link>
		<comments>http://outstando.com/thoughtplifier/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 01:45:28 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[Thoughtplifier]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=291</guid>
		<description><![CDATA[Thougthplifier is a one-column focus-to-content WordPress theme i crafted based on Essential Theme modification i made for my personal blog and outstando. Some folks asked me to release it so here it is, after some modifications to make it more customizable. Thoughtplifier is designed to be as simple as possible yet functional to use. However, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-front.png"><img class="alignnone size-full wp-image-295" title="Thoughtplifier front" src="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-front.png" alt="Thoughtplifier Theme" width="480" height="360" /></a></p>
<p><strong>Thougthplifier</strong> is a one-column focus-to-content WordPress theme i crafted based on <a title="Free Download: The Essential Theme" href="http://outstando.com/essential/" target="_blank">Essential Theme</a> modification i made for <a title="Fikri Rasyid's Personal Blog" href="http://fikrirasyid.com" target="_blank">my personal blog</a> and <a title="Outstando" href="http://outstando.com" target="_blank">outstando</a>. Some folks asked me to release it so here it is, after some modifications to make it more customizable.</p>
<p><span id="more-291"></span></p>
<p>Thoughtplifier is designed to be as simple as possible yet functional to use. However, please notice that <em><strong>the development of the theme hasn&#8217;t done yet</strong></em>. I&#8217;m applying <em>release-early-release-often-thing</em> to this theme. If you find any bug, please tell me through <a title="Thoughtplifier Issue" href="https://github.com/fikrirasyid/thoughtplifier/issues" target="_blank">Thoughtplifier&#8217;s Github issue page</a>. I also invite any of you who wants to use this theme to collaborate: fork, commit, feature suggesting, or anything you can imagine. Just go throug <a title="Thoughtplifier Issue Page" href="https://github.com/fikrirasyid/thoughtplifier" target="_blank">Thoughtplifier&#8217;s Github page</a>.</p>
<h2>Demo &amp; Download</h2>
<p>Demo site will available soon. Meanwhile, you may check this site. Outstando is using Thoughtplifier.</p>
<p><a title="Download Thoughtplifier Theme" href="https://github.com/fikrirasyid/thoughtplifier/zipball/master" target="_blank" class="button"><strong>Click here to Download Thoughtplifier Theme</strong></a></p>
<h2>Features</h2>
<h3>Added on version 0.1 (August 22, 2011)</h3>
<ul>
<li>WordPress custom menu</li>
<li>Dropdown menu</li>
<li>Widget areas on navbar &amp; footer</li>
<li>Featured image support</li>
<li>Pagination navigation</li>
<li>Author box</li>
<li>Related posts box</li>
<li>Support threaded comment</li>
<li>Well styled content styling</li>
<li>Customizable color scheme</li>
<li>More features to come. Please suggest features you want through <a title="Thoughtplifier Github Page" href="https://github.com/fikrirasyid/thoughtplifier" target="_blank">Thoughtplifier Github page</a>. We&#8217;ll discuss it.</li>
</ul>
<h2>Screenshots</h2>
<p><a href="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-Post-Features.png"><img class="alignnone size-full wp-image-296" title="Thoughtplifier Post Features" src="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-Post-Features.png" alt="" width="480" height="360" /></a></p>
<p><a href="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-Theme-Options.png"><img class="alignnone size-full wp-image-297" title="Thoughtplifier Theme Options" src="http://outstando.com/wp-content/uploads/2011/08/Thoughtplifier-Theme-Options.png" alt="" width="480" height="360" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/thoughtplifier/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress Manageable Random Background Using Post-Type</title>
		<link>http://outstando.com/wordpress-manageable-random-background-using-post-type/</link>
		<comments>http://outstando.com/wordpress-manageable-random-background-using-post-type/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 03:16:23 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Dashboard]]></category>
		<category><![CDATA[Manageable]]></category>
		<category><![CDATA[post type]]></category>
		<category><![CDATA[Random Background]]></category>
		<category><![CDATA[Theme Hack]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=285</guid>
		<description><![CDATA[We&#8217;ve discussed about creating simple random background in WordPress, including its cons which has no back-end interface, on the previous post. Some people are okay with having no backend interface since they have access to put the image directly on the server&#8217;s directory. However, for less-geeky person, this can be a trouble. This post will [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-264" title="WordPress Tutorials" src="http://outstando.com/wp-content/uploads/2011/04/WordPress.png" alt="WordPress Tutorials" width="480" height="360" /></p>
<p>We&#8217;ve discussed about <a title="WordPress Simple Random Background Using Matt Mullenweg’s randomimage script " href="http://outstando.com/wordpress-simple-random-background-using-matt-mullenwegs-randomimage-script/">creating simple random background in WordPress</a>, including its cons which has no back-end interface, on the previous post. Some people are okay with having no backend interface since they have access to put the image directly on the server&#8217;s directory. However, for less-geeky person, this can be a trouble. This post will show you the fix of this issue: we&#8217;re going to <strong>create a more manageable random background feature which has a backend interface</strong>.</p>
<p>Basically, these are what to do to create this feature:<span id="more-285"></span></p>
<ol>
<li> Open <code>functions.php</code> file of your theme</li>
<li> Create a new custom post-type with post-thumbnail support enabled. Let&#8217;s name it <code>random-background</code></li>
<li>Modify its post column edit page to make it more neat</li>
<li>Create a function which generates stylesheet that modified the background using <code>random-background</code>&#8216;s post-thumbnail</li>
<li><a title="Hooking Function Using add_action()" href="http://outstando.com/hooking-function-using-add_action/">Hook the function</a> which generates stylesheet into <code>wp_head()</code></li>
</ol>
<p>That&#8217;s all. Here are the functions:</p>
<h2>1. Create a new custom post-type with post-thumbnail support enabled. Let&#8217;s name it <code>random-background</code></h2>
<p>Open your <code>functions.php</code> and paste this function. This function will create new post-type called random-background and generate the dashboard interface.</p>
<pre class="brush:php">// Add custom post type called random-background
add_action('init', 'ess_manageable_random_background_posttype');
function ess_manageable_random_background_posttype()
{
$labels = array(
'name' =&gt; _x('Backgrounds', 'post type general name'),
'singular_name' =&gt; _x('Background', 'post type singular name'),
'add_new' =&gt; _x('Add New', 'book'),
'add_new_item' =&gt; __('Add New Background'),
'edit_item' =&gt; __('Edit Background'),
'new_item' =&gt; __('New Background'),
'view_item' =&gt; __('View Background'),
'search_items' =&gt; __('Search Background'),
'not_found' =&gt;  __('No background found'),
'not_found_in_trash' =&gt; __('No background found in Trash'),
'parent_item_colon' =&gt; ''
);
$args = array(
'labels' =&gt; $labels,
'public' =&gt; true,
'publicly_queryable' =&gt; true,
'show_ui' =&gt; true,
'query_var' =&gt; true,
'rewrite' =&gt; true,
'capability_type' =&gt; 'post',
'hierarchical' =&gt; false,
'menu_position' =&gt; null,
'supports' =&gt; array('title', 'excerpt', 'thumbnail')
);
register_post_type('random-background',$args);
}
</pre>
<h2>2. Modify its post column edit page to make it more neat</h2>
<p>Since we&#8217;re only use the title, excerpt, and post thumbnail, let&#8217;s modify the post column to show only those three things. Paste these functions below the previous function:</p>
<pre class="brush:php">// Modifying the edit page
add_filter("manage_edit-random-background_columns", "title_ess_manageable_random_background");
add_action("manage_posts_custom_column", "ess_manageable_random_background_columns");

function title_ess_manageable_random_background($columns) //this function display the columns headings
{
$columns = array(
"cb" =&gt; "&lt;input type=\"checkbox\" /&gt;",
"title" =&gt; "Background Title",
"description" =&gt; "Description",
"thumbnail" =&gt; "Thumbnail"
);
return $columns;
}

function ess_manageable_random_background_columns($column)
{
global $post;
switch ($column)
{
case "description":
the_excerpt();
break;

case "thumbnail":
the_post_thumbnail('home-thumb');
break;
}
}
</pre>
<h2>3. Create a function which generates stylesheet that modified the background using random-background&#8217;s post-thumbnail</h2>
<p>Select one random post and pull its post-thumbnail. Print it as a stylesheet. Paste this function below the previous functions.</p>
<pre class="brush:php">// Printing the background
function ess_manageable_random_background(){

$backgrounds = get_posts('post_type=random-background&amp;numberposts=1&amp;orderby=rand');
foreach( $backgrounds as $post ) :
setup_postdata($post);

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), 'home-main' );
echo '&lt;style type="text/css"&gt; body{background:url(' . $image[0] . ');}&lt;/style&gt;';

endforeach;
wp_reset_query();

}
</pre>
<h2>4. Hook it into the <code>wp_head!</code></h2>
<p>Hook it into wp_head so it appears on the <code>head</code> section. Paste this function below the previous functions:</p>
<pre class="brush:php">// Hook ess_manageable_random_background() into wp_head()
add_action("wp_head", "ess_manageable_random_background");
</pre>
<p style="text-align: center;">*****</p>
<p><img class="alignnone size-full wp-image-286" title="background columns" src="http://outstando.com/wp-content/uploads/2011/04/background-columns.png" alt="background columns" width="480" height="200" /></p>
<p>Kudos! Now manageable random background feature for your WordPress theme has been created. To use it, go to <strong>Dashboard &gt; Backgrounds &gt; Add New</strong>. Type the title and description, then set the <strong>featured image</strong>. This featured image is the one that will be pulled by <code>ess_manageable_random_background()</code> function. After you&#8217;ve set the featured image, hit the publish button. Voila! It&#8217;s all done. Repeat the task to add more backgrounds.</p>
<p>FYI, If you&#8217;d like see how does it work, as usual i&#8217;ve made the TwentyTen Child Theme which uses this feature. <a title="Child Theme Demo of WordPress Manageable Random Background Using Post-Type" href="http://bit.ly/manageablerandombg">Download the demo here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/wordpress-manageable-random-background-using-post-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Simple Random Background Using Matt Mullenweg&#8217;s randomimage script</title>
		<link>http://outstando.com/wordpress-simple-random-background-using-matt-mullenwegs-randomimage-script/</link>
		<comments>http://outstando.com/wordpress-simple-random-background-using-matt-mullenwegs-randomimage-script/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 00:46:05 +0000</pubDate>
		<dc:creator>Fikri Rasyid</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Background]]></category>
		<category><![CDATA[Matt Mullenweg]]></category>
		<category><![CDATA[Random Background]]></category>
		<category><![CDATA[randomimage]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://outstando.com/?p=280</guid>
		<description><![CDATA[Several days ago, a friend of mine @arhamHaryadi asked me about how to make a random background which changes every time visitor visit / refresh the page. The answer is simple yet easy, use Matt Mullenweg&#8217;s randomimage script. Instruction of how to use it is pretty self-explanatory on that script. However, some of you probably [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-264" title="WordPress Tutorials" src="http://outstando.com/wp-content/uploads/2011/04/WordPress.png" alt="WordPress Tutorials" width="480" height="360" /></p>
<p>Several days ago, a friend of mine @<a title="Arham Haryadi on Twitter" href="http://twitter.com/arhamHaryadi">arhamHaryadi</a> asked me about how to make a <strong>random background which changes every time visitor visit / refresh the page</strong>. The answer is simple yet easy, use <a title="Random Image Script" href="http://ma.tt/scripts/randomimage/">Matt Mullenweg&#8217;s randomimage script</a>. Instruction of how to use it is pretty self-explanatory on that script. However, some of you probably want to use it on your theme. Here&#8217;s the quick how-to integrate it into your WordPress theme:</p>
<ol>
<li>Create a directory on your theme folder named <code>randombg</code>. Put all images you want to use as random background on this directory.</li>
<li>Create a file named <code>randomimage.php</code> inside the freshly-created <code>randombg</code> directory. Copy and paste <a title="Random Image Script" href="http://ma.tt/scripts/randomimage/">Matt&#8217;s randomimage script</a> into that file.</li>
<li>Open your theme&#8217;s <code>functions.php</code> file and paste these functions. Read the comment on the script for further explanation. Basically what these functions do are <strong>printing a stylesheet and <a title="Hooking Function Using add_action()" href="http://outstando.com/hooking-function-using-add_action/">hooking it</a> into <code>wp_head()</code></strong> theme hook.<span id="more-280"></span>
<pre class="brush:php">// Hooking ess_random_background() to wp_head()
add_action("wp_head", "ess_random_background");

// Printing random image background stylesheet. Random image calling is done by Matt Mullenweg's randomimage script
function ess_random_background(){
?&gt;
&lt;style type="text/css"&gt;
body    {background:url(&lt;?php bloginfo("stylesheet_directory"); ?&gt;/randombg/randomimage.php);}
&lt;/style&gt;
&lt;?php
}
</pre>
</li>
</ol>
<p>That&#8217;s it. Pretty simple and easy to do, huh? This is the simplest way i know to create random background functionality to your WordPress theme. However, this trick has a downside: <strong>it has no back-end / dashboard interface so user should have an access to the FTP to put the image file on <code>randombg</code> directory</strong>. I&#8217;ve had a more manageable alternative than this, using <a title="WordPress custom post-type" href="http://codex.wordpress.org/Post_Types">WordPress custom post-type</a> feature. I&#8217;ll discuss it on the next post. Stay tune on Outstando.</p>
<h2>P.S.</h2>
<p>I&#8217;ve made a twentyten child theme demo which uses this trick, just in case you want to see how does it actually work.</p>
<p><a title="TwentyTen Child Theme Demo of WordPress Simple Random Background Using Matt Mullenweg's randomimage script" href="http://bit.ly/simplerandomimagebg">Download the file here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://outstando.com/wordpress-simple-random-background-using-matt-mullenwegs-randomimage-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

