<?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>AEXT.NET &#187; Tutorials</title>
	<atom:link href="http://aext.net/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://aext.net</link>
	<description>Programming, Designing and Blogging</description>
	<lastBuildDate>Fri, 12 Mar 2010 11:30:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick Tip: How to Get Great HTML Meta Tags</title>
		<link>http://aext.net/2010/03/great-html-meta-tags-tip/</link>
		<comments>http://aext.net/2010/03/great-html-meta-tags-tip/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 08:20:21 +0000</pubDate>
		<dc:creator>Hannah Wiggins</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[html meta tag]]></category>
		<category><![CDATA[search engines optimization]]></category>

		<guid isPermaLink="false">http://aext.net/?p=4301</guid>
		<description><![CDATA[When you&#8217;re reading around the web about what to focus on when creating a web page, and you&#8217;re sure to find a host of opinions which, in total, insist that every single page element holds the secret to attracting traffic, pleasing visitors, or simply &#8220;doing it right.&#8221; Though some page elements are necessarily more crucial [...]


Related posts:<ol><li><a href='http://aext.net/2010/03/highlight-author-comments-wordpress-right-way/' rel='bookmark' title='Permanent Link: Quick Tip: Highlight Author Comments in WordPress &#8211; The Right Way'>Quick Tip: Highlight Author Comments in WordPress &#8211; The Right Way</a></li>
<li><a href='http://aext.net/2009/08/make-a-most-beautiful-tags-cloud-on-over-the-world-with-facelift-and-jquery/' rel='bookmark' title='Permanent Link: Make a most beautiful tags cloud on over the world with Facelift and jQuery'>Make a most beautiful tags cloud on over the world with Facelift and jQuery</a></li>
<li><a href='http://aext.net/2007/02/html-vs-xhtml-how-to-convert-html-to-xhtml/' rel='bookmark' title='Permanent Link: HTML vs. XHTML &#8211; How to Convert HTML to XHTML'>HTML vs. XHTML &#8211; How to Convert HTML to XHTML</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When you&#8217;re reading around the web about what to focus on when creating a web page, and you&#8217;re sure to find a host of opinions which, in total, insist that every single page element holds the secret to attracting traffic, pleasing visitors, or simply &#8220;doing it right.&#8221; Though some page elements are necessarily more crucial in terms of their uniformity than others, designers and developers can count on the essential nature of the HTML meta tag on any given web page. </p>
<p>Meta tags are capable of telling search engines and other interested parties key information about the contents of the page, the meta tag is arguably as important as the page&#8217;s actual title&#8211;yet it leaves greater room for taking advantage of keyword use and relaxing the rules of style.</p>
<p><span id="more-4301"></span></p>
<p>Of the many attributes that can be defined using a meta tag, the description tag is likely to be the most meaningful for modern sites. As some search engines do not include support for a keywords tag (really only Yahoo uses this), creating a solid description that manages to work in keywords without over-stuffing can yield SEO-friendly results. (Though, limiting your keywords to two or three per page will help get you higher search engine rankings and more targeted traffic.) The language and robots tags are also likely to be used on a number of pages, though the majority of sites utilize English and specifically allow bots to scan and index at liberty. To achieve picture-perfect meta tags of these types, a simple copy and paste job is often sufficient.</p>
<p>It&#8217;s not a good idea to place long content inside HTML meta tags&#8211;5 to 10 words should be enough&#8211;and you shouldn&#8217;t use words you haven&#8217;t mentioned on the page as well. Most search engines have require a maximum of:</p>
<ul>
<li>60 characters for the title.</li>
<li>160 characters for the description.</li>
</ul>
<p>No matter which meta tag you&#8217;re defining, though, you&#8217;ll need to ensure that your syntax is in working order. Always close your tags and observe proper attribute spelling and usage:</p>
<pre>&lt;META name="description" content="Because when you use clean syntax and keep an eye out for errors, your work will benefit." /&gt;</pre>
<p>Though meta tags are sometimes shrouded in an air of mystery by webmasters who insist that only their formula will work, paying attention to form and using keywords intelligently will go a long way towards making any page great.</p>


<p>Related posts:<ol><li><a href='http://aext.net/2010/03/highlight-author-comments-wordpress-right-way/' rel='bookmark' title='Permanent Link: Quick Tip: Highlight Author Comments in WordPress &#8211; The Right Way'>Quick Tip: Highlight Author Comments in WordPress &#8211; The Right Way</a></li>
<li><a href='http://aext.net/2009/08/make-a-most-beautiful-tags-cloud-on-over-the-world-with-facelift-and-jquery/' rel='bookmark' title='Permanent Link: Make a most beautiful tags cloud on over the world with Facelift and jQuery'>Make a most beautiful tags cloud on over the world with Facelift and jQuery</a></li>
<li><a href='http://aext.net/2007/02/html-vs-xhtml-how-to-convert-html-to-xhtml/' rel='bookmark' title='Permanent Link: HTML vs. XHTML &#8211; How to Convert HTML to XHTML'>HTML vs. XHTML &#8211; How to Convert HTML to XHTML</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/03/great-html-meta-tags-tip/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Highlight Author Comments in WordPress &#8211; The Right Way</title>
		<link>http://aext.net/2010/03/highlight-author-comments-wordpress-right-way/</link>
		<comments>http://aext.net/2010/03/highlight-author-comments-wordpress-right-way/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 08:35:06 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress Comment]]></category>
		<category><![CDATA[WordPress Tips]]></category>

		<guid isPermaLink="false">http://aext.net/?p=4116</guid>
		<description><![CDATA[This is an old topic that has been covered by many other blogs and magazines&#8211;to the extreme, but it needs updating. I&#8217;m talking about how to highlight comments posted by the author of the article. The tutorials out there only work for one user ID for the whole site. That is a big mistake, as [...]


Related posts:<ol><li><a href='http://aext.net/2010/03/great-html-meta-tags-tip/' rel='bookmark' title='Permanent Link: Quick Tip: How to Get Great HTML Meta Tags'>Quick Tip: How to Get Great HTML Meta Tags</a></li>
<li><a href='http://aext.net/2009/12/10-useful-code-snippets-and-plugins-to-spice-up-wordpress-avatar/' rel='bookmark' title='Permanent Link: 10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar'>10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar</a></li>
<li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is an old topic that has been covered by many other blogs and magazines&#8211;to the extreme, but it needs updating. I&#8217;m talking about how to highlight comments posted by the author of the article. The tutorials out there only work for one user ID for the whole site. That is a big mistake, as it didn&#8217;t allow for scalability &#8212; it only works when you are blogging on your own (and with only one account). We have given it an overhaul, and updated the code.</p>
<p><span id="more-4116"></span></p>
<p>First, we should take a look at the code from the tutorials which highlight the comment based on the user ID:</p>
<pre class="html">
.authcomment {
&nbsp;&nbsp;&nbsp;&nbsp;background-color: #B3FFCC !important;
}

&lt;li class=&rdquo;&lt;?php 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (1 == $comment-&gt;user_id)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$oddcomment = &ldquo;authcomment&rdquo;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $oddcomment;?&gt;&rdquo; id=&rdquo;comment&hellip;&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/li&gt;
</pre>
<p>To make it work on sites with multiple writers, we need to to get the ID of the author, then check if the ID of the person posting this comment is the same. If it is, we need to make it stand out. We still use the CSS class for post author comment.</p>
<pre class="css">
.authcomment {
&nbsp;&nbsp;&nbsp;&nbsp;background-color: #B3FFCC !important;
}
</pre>
<p>Now, we change the original code at the start of the article with this:</p>
<pre class="html">
&lt;li class=&quot;comment-container
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$authID=get_the_author_meta('ID');
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($authID == $comment-&gt;user_id)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$oddcomment = 'authcomment';
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $oddcomment;
&nbsp;&nbsp;&nbsp;&nbsp;?&gt;&quot; &nbsp;id=&quot;comment-&lt;?php comment_ID(); ?&gt;&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/li&gt;
</pre>
<p>And, that&#8217;s it! We hope that you find it useful!</p>


<p>Related posts:<ol><li><a href='http://aext.net/2010/03/great-html-meta-tags-tip/' rel='bookmark' title='Permanent Link: Quick Tip: How to Get Great HTML Meta Tags'>Quick Tip: How to Get Great HTML Meta Tags</a></li>
<li><a href='http://aext.net/2009/12/10-useful-code-snippets-and-plugins-to-spice-up-wordpress-avatar/' rel='bookmark' title='Permanent Link: 10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar'>10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar</a></li>
<li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/03/highlight-author-comments-wordpress-right-way/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>How jQuery is Killing Flash + jQuery Tutorials &amp; Plugins to Beat Up Flash Animations</title>
		<link>http://aext.net/2010/03/javascript-jquery-killing-flash-tutorial-jquery-plugin/</link>
		<comments>http://aext.net/2010/03/javascript-jquery-killing-flash-tutorial-jquery-plugin/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 06:10:26 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Popular]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[javascript framework]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Plugin]]></category>
		<category><![CDATA[jQuery Tutorial]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://aext.net/?p=2930</guid>
		<description><![CDATA[In 1996, Macromedia released their product called Macromedia Flash which is a vector-based animation platform. With Flash, web designers were now able to create animations using a timeline and vector design tools as a video. Furthermore, Flash was and still is a great solution for web designers to provide visitors smooth view in such small [...]


Related posts:<ol><li><a href='http://aext.net/2009/11/5-fresh-and-useful-jquery-plugins-were-born-in-november-2009/' rel='bookmark' title='Permanent Link: 5 Fresh and Useful jQuery Plugins Were Born in November 2009'>5 Fresh and Useful jQuery Plugins Were Born in November 2009</a></li>
<li><a href='http://aext.net/2009/12/dont-miss-out-latest-10-jquery-plugins-before-closing-the-year-2009/' rel='bookmark' title='Permanent Link: Don&#8217;t Miss Out Latest 10 jQuery Plugins Before Closing The Year 2009'>Don&#8217;t Miss Out Latest 10 jQuery Plugins Before Closing The Year 2009</a></li>
<li><a href='http://aext.net/2009/12/why-do-we-love-these-5-fresh-and-awesome-jquery-plugins/' rel='bookmark' title='Permanent Link: Why Do We Love These 5 Fresh and Awesome jQuery Plugins?'>Why Do We Love These 5 Fresh and Awesome jQuery Plugins?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In 1996, Macromedia released their product called Macromedia Flash which is a vector-based animation platform. With Flash, web designers were now able to create animations using a timeline and vector design tools as a video. Furthermore, Flash was and still is a great solution for web designers to provide visitors smooth view in such small file size. The only thing that web surfers need to enjoy the sites using flash is to install Macromedia Flash Player.</p>
<p>However, with the arrival of JavaScript in 1997, there has been a war between Flash and JavaScript because Flash was afraid JavaScript would one day replace them with all the animation it supports. Why? Because a ton of JavaScript frameworks are becoming increasingly popular as a result of their high scalability, performance and usability.  Some include jQuery, MooTools, script.aculo.us, Prototype, among others but especially jQuery, as of late.</p>
<p>jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and AJAX interactions for rapid web development. Although you may have enough Javascript skills to build your own Javascript code, using jQuery instead of can simplify the process (think hundreds of lines vs. a few lines of jQuery). Furthermore, there are thousands of plugins for jQuery published and large community support for this project. jQuery deserves being the heaviest competitor with Flash.</p>
<p><span id="more-2930"></span></p>
<h3>Why should we use jQuery instead of Flash</h3>
<hr />
<p>There are a bulk of differences regarding the benefits and disadvantages between these two guys, but in this article, we just list some their most important features.</p>
<p>First, in order to build an application using jQuery, you don&#8217;t have to purchase anything, but with Flash you have to buy Flash software to do the encoding. And Flash software could cost you <strong style="color: red">$699</strong> and no less than <strong style="color: red">$199</strong> to upgrade from older versions. jQuery and most other JavaScript frameworks cost you nothing to use <em>(some jQuery plugins are not free for commercial usage)</em>. At this point, <strong>jQuery wins!</strong></p>
<p><img src="http://aext.net/wp-contents/uploads/2010/02/iphone.flash.jpg" alt="" title="iphone.flash" width="175"  class="aligncenter size-full wp-image-4080" style="float: right; margin: 0 0 30px 30px;" />The second and the most problem with Flash is it isn&#8217;t available on the iPhone, and many other mobile devices. According to Adobe, 98 percent of desktop computers and laptops currently support Flash, but the truth is it&#8217;s not compatible with all browsers including those on the iPhone, iPad and cell phones. Unlike Flash, jQuery supports screen reader accessibility. By using <a href="http://plugins.jquery.com/project/accDND" rel="nofollow" >accDND</a> (a jQuery plugin), we can enable keyboard and screen reader which is an accessible drag &amp; drop functionality plugin for jQuery. <strong>jQuery wins again!</strong>.</p>
<p>In the next comparison, we&#8217;ll consider using jQuery instead of Flash in its customization. jQuery and other JavaScript frameworks are built for easy development and customization.</p>
<p>Although jQuery wins Flash in some angles of problem, it cannot fully replace Flash in use. Where Flash fully supports 3D capabilities and many extensive features for object animation, jQuery is limited. Furthermore, jQuery UI is nothing compared with Flash&#8217;s built-in UI &#8211; That&#8217;s one reason for Flash&#8217;s price tag.  Besides this, we get problems with proper font display. We can use any fonts on the web with Flash, but we cannot do the same with JavaScript, although we have a ton of tools and services available to help us to embed fonts in HTML page.</p>
<p>One other area to look at is video.  This is where HTML5 comes into the picture &#8212; which is a completely different post in and of itself.</p>
<p>In most cases, though, jQuery can do better than Flash. From here, we&#8217;ll round up some tutorials and jQuery plugins that are simply awesome. Each of these teaches how to get a desired &quot;Flash&quot; effect, but with jQuery instead.</p>
<h3 style="color: red;">Tutorials</h3>
<hr />
<h3><a href="http://www.newmediacampaigns.com/page/jquery-vs-flash-for-interactive-map" rel="nofollow" >Building an interactive map with jQuery instead of Flash</a></h3>
<div class="bigimage">
<a href="http://www.newmediacampaigns.com/page/jquery-vs-flash-for-interactive-map" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/Map-with-jQuery-500x187.jpg" alt="" title="Map with jQuery" width="500" height="187" class="aligncenter size-medium wp-image-2931" /></a>
</div>
<p>This tutorial helps you build an interactive map with jQuery instead of Flash. It helps you build the markup for the maps and a couple of jQuery functions to make it all work. It&#8217;ll be an interactive map that shows some information and the location of the various Marine Science outposts across the state. Information of the the locations are represented by dots, and clicking them, will display an info box.</p>
<h3><a href="http://tutorialzine.com/2009/12/animated-share-buttons-jquery-css/" rel="nofollow" >Animated Sharing Bar With jQuery &#038; CSS</a></h3>
<div class="bigimage">
<a href="http://tutorialzine.com/2009/12/animated-share-buttons-jquery-css/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/Animated-Share-Bar-500x223.png" alt="" title="Animated Share Bar" width="500" height="223" class="aligncenter size-medium wp-image-2932" /></a>
</div>
<p>Using pure jQuery, we can make an animated sharing bar which will enable your website visitors to share posts on a number of social networks. It runs smoothly on all browser versions.</p>
<h3><a href="http://youlove.us/blog/the-youloveus-scrolling-background-effect-explained" rel="nofollow" >The youlove.us scrolling background effect explained</a></h3>
<div class="bigimage">
<a href="http://youlove.us/blog/the-youloveus-scrolling-background-effect-explained" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/youloveus-background-explained-500x124.png" alt="" title="youloveus background explained" width="500" height="124" class="aligncenter size-medium wp-image-2933" /></a>
</div>
<p>If you have checked out the design of YouLove.us, you would be excited with its colorful animated background.  Here they explained how they created their beautiful animated background. The technique is very simple. It will scroll only the body background while every element above it is transparent.</p>
<h3><a href="http://buildinternet.com/2009/08/crafting-an-animated-postcard-with-jquery/" rel="nofollow" >Crafting an Animated Postcard With jQuery</a></h3>
<div class="bigimage">
<a href="http://buildinternet.com/2009/08/crafting-an-animated-postcard-with-jquery/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/postcard-500x133.jpg" alt="" title="postcard" width="500" height="133" class="aligncenter size-medium wp-image-2938" /></a>
</div>
<p>Learn the basics of setting up a continuous animation with an illustrated postcard which Flash usually does. This tutorial is a good one for you to learn how to work with animation loop in jQuery and the easing plugin.</p>
<h3><a href="http://css-tricks.com/jquery-robot/" rel="nofollow" >Building an Animated Cartoon Robot with jQuery</a></h3>
<div class="bigimage">
<a href="http://css-tricks.com/jquery-robot/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/Animated-Cartoon-Robot-with-jQuery-1024x452.png" alt="" title="Animated Cartoon Robot with jQuery" width="500" class="aligncenter size-large wp-image-2972" /></a>
</div>
<p>A tutorial on CSS-tricks to create an incredible animated cartoon robot. It was created by layering several empty divs over each other with transparent PNGs as background images. This effect simulates a faux 3D animated background dubbed the “parallax effect” originating from old-school side scrolling video games. <strong>This is one of the best examples of where jQuery is replacing Flash.</strong></p>
<h3><a href="http://acko.net/blog/abusing-jquery-animate-for-fun-and-profit-and-bacon" rel="nofollow" >Cloud of Bacon</a></h3>
<div class="smallimage">
<a href="http://acko.net/blog/abusing-jquery-animate-for-fun-and-profit-and-bacon" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-27-at-12.54.43-AM.png" alt="" title="jQuery.animate() Bacon" width="396" height="298" class="aligncenter size-full wp-image-4096" /></a>
</div>
<p>In this tutorial, you will be inspired with the camera effect. The tutorial runs multiple animations (of arbitrary duration) at the same time, queues animations and even animates complex properties like colors or clipping rectangles.</p>
<h3><a href="http://tutorialzine.com/2009/12/colorful-clock-jquery-css/" rel="nofollow" >A Colorful Clock With CSS &#038; jQuery</a></h3>
<div class="bigimage">
<a href="http://tutorialzine.com/2009/12/colorful-clock-jquery-css/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/i13-499x209.jpg" alt="" title="A Colorful Clock With CSS &amp; jQuery" width="499" height="209" class="aligncenter size-medium wp-image-2977" /></a>
</div>
<p>Here&#8217;s a colorful clock created with jQuery and CSS only. This is really an interesting post to check out. It&#8217;s not a tutorial about the jQuery animate() function, but the jQuery helps CSS animation property works correctly. I highly recommend checking out all of the <a href="http://tutorialzine.com/2009/12/colorful-clock-http://tutorialzine.com" rel="nofollow" >Tutorialzine</a> Tutorials for jQuery inspiration.</p>
<h3><a href="http://net.tutsplus.com/tutorials/javascript-ajax/jquery-os-x-style-dock-and-stack-navigation/" rel="nofollow" >jQuery OS X Stack and Drop Stack</a></h3>
<div class="bigimage">
<a href="http://net.tutsplus.com/tutorials/javascript-ajax/jquery-os-x-style-dock-and-stack-navigation/"><img src="http://aext.net/wp-contents/uploads/2010/01/Screen-shot-2010-01-18-at-8.12.23-PM-e1263867217485.png" alt="" title="“Outside the Box” Navigation with jQuery" width="499" height="348" class="aligncenter size-medium wp-image-2983" /><br />
</a>
</div>
<p>A sexy menu created using jQuery and CSS with OS X style docks and stacks navigation. It&#8217;s super lightweight (~1kb) and is a really creative &#8220;outside the box&#8221; method of navigation for a website. It might be a little awkward having the navigation in the bottom right or left of the browser window but it would certainly be creative and saves lots of space.</p>
<h3><a href="http://css-tricks.com/css3-clock/" rel="nofollow" >Old School Clock with CSS3 and jQuery</a></h3>
<div class="bigimage">
<a href="http://css-tricks.com/css3-clock/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/clock-500x172.jpg" alt="" title="clock" width="500" height="172" class="aligncenter size-medium wp-image-4072" /></a>
</div>
<p>Transform:rotate is a new feature of CSS3 which lets you rotate HTML elements. This tutorial will help you create an awesome &#8220;tick tock&#8221; clock that animates very smoothly. The jQuery code in this tutorial helps the clock get correct time information then inject all the CSS3 style for each element.</p>
<h3><a href="http://www.devirtuoso.com/2009/09/making-a-3d-engine-in-jquery/" rel="nofollow" >Making a 3D Engine in jQuery</a></h3>
<div class="bigimage">
<a href="http://www.devirtuoso.com/2009/09/making-a-3d-engine-in-jquery/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-27-at-2.03.52-AM.png" alt="" title="3D Cube" width="500" height="237" class="aligncenter size-full wp-image-4106" /></a>
</div>
<p>Here they create a 3D engine that will allow us to create shapes simply by creating an array of points. This engine will have a Camera, a Scene and an Object. Perfect 3D cube in jQuery!</p>
<h3><a href="http://www.gayadesign.com/diy/puffing-smoke-effect-in-jquery/" rel="nofollow" >Puffing Smoke Effect in jQuery</a></h3>
<div class="bigimage">
<a href="http://www.gayadesign.com/diy/puffing-smoke-effect-in-jquery/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-27-at-1.23.48-AM.png" alt="" title="Smoking" width="500" height="136" class="aligncenter size-full wp-image-4098" /></a>
</div>
<p>An excellent tutorial features an impressive animation effect of cartoon-ish smoke which animates from factory smoke stacks. This tutorial provides a configurable jQuery plugin with instructions based on blog&#8217;s header of the author, so that you may create a similar animation effect for your website.</p>
<h3 style="color: red;">Plugins</h3>
<hr />
<h3><a href="http://webdev.stephband.info/parallax.html" rel="nofollow" >jParallax</a></h3>
<div class="bigimage">
<a href="http://webdev.stephband.info/parallax.html" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/diagram_parallax.png" alt="" title="diagram_parallax" width="500" height="295" class="aligncenter size-full wp-image-2940" /></a>
</div>
<p>jParallax is a jQuery plugin that allows animation of simple parallax animations by animating the background-position of <span style="color:#881280;">&lt;div&gt;</span> elements.</p>
<h3><a href="http://www.jquery.info/scripts/jFlip/demo.html" rel="nofollow" >jFlip</a></h3>
<div class="bigimage">
<a href="http://www.jquery.info/scripts/jFlip/demo.html" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/01/jFlip-Gallery-Demo.png" alt="" title="jFlip Gallery Demo" width="500" height="311" class="aligncenter size-full wp-image-2975" /></a>
</div>
<p>Create page flip using jQuery plugin instead of Flash. This plugins is useful for us to create the page flip effect that can be used in flipping page of a book. It could be a great idea for a comic book web site.</p>
<h3><a href="http://elliottkember.com/sexy_curls.html" rel="nofollow" >The Sexy Curls jQuery Plugin!</a></h3>
<div class="bigimage">
<a href="http://elliottkember.com/sexy_curls.html" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-25-at-11.39.26-PM.png" alt="" title="Sexy curls" width="500" height="203" class="aligncenter size-full wp-image-4074" /></a>
</div>
<p>Another great jQuery plugin which lets you share in the beauty of the page fold. Remember in the past, we always use Flash to create this effect for ad slot. Today, forget Flash and try it with jQuery. Everything is the same except you&#8217;re not relying on Flash, guys!</p>
<h3><a href="http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" rel="nofollow" >Easy Slider 1.7 &#8211; Numeric Navigation jQuery Slider</a></h3>
<div class="bigimage">
<a href="hhttp://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-27-at-1.39.26-AM-500x155.png" alt="" title="Easy Slider 1.7" width="500" height="155" class="aligncenter size-medium wp-image-4101" /></a>
</div>
<p>This is really a nightmare with Flash because jQuery does it perfectly and even better than Flash does. There are a bulk of jQuery Slider Plugins out there, but <strong>Easy Slider</strong> is arguably the best one with a lot of features and options.</p>
<h3><a href="http://css-tricks.com/anythingslider-jquery-plugin/" rel="nofollow" >AnythingSlider jQuery Plugin</a></h3>
<div class="smallimage">
<a href="http://css-tricks.com/anythingslider-jquery-plugin/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/anythingslider-example-500x246.jpg" alt="" title="anythingslider-example" width="500" height="246" class="aligncenter size-medium wp-image-4103" /></a>
</div>
<p>This is another awesome jQuery slider that comes with cool features. AnythingSlider is a plugin that was built to make implementing it and customizing it much easier than other plugins.</p>
<h3><a href="http://jquery.vostrel.cz/reel/" rel="nofollow" >reel</a></h3>
<div class="bigimage">
<a href="http://jquery.vostrel.cz/reel" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-26-at-1.59.18-AM.png" alt="" title="Reel" width="500" height="144" class="aligncenter size-full wp-image-4077" /></a>
</div>
<p>Reel is a jQuery plugin which takes an image tag and makes it a live &#8220;projection&#8221; of pre-built animation frames sequence. Its aim is to provide a 360° view of something or someplace. It&#8217;s a great alternative to widely used Flash techniques.</p>
<h3><a href="http://code.google.com/p/flot/" rel="nofollow" >Flot</a></h3>
<div class="bigimage">
<a href="http://code.google.com/p/flot/" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/flot-screenshot-499x252.png" alt="" title="flot-screenshot" width="499" height="252" class="aligncenter size-medium wp-image-4109" /></a>
</div>
<p>Flot is a pure JavaScript plotting library for jQuery. It produces graphical plots of arbitrary datasets on-the-fly client-side. Like Flash, this plugin provides smooth and attractive graph for simple uses with nice features, zooming and mouse tracking.</p>
<h3><a href="http://deepliquid.com/content/Jcrop.html" rel="nofollow" >jCrop</a></h3>
<div class="bigimage">
<a href="http://deepliquid.com/content/Jcrop.html" rel="nofollow" ><img src="http://aext.net/wp-contents/uploads/2010/02/jquery-crop.png" alt="" title="jquery-crop" width="480" height="188" class="aligncenter size-full wp-image-4111" /></a>
</div>
<p>jCrop is a powerful image cropping engine for jQuery. It combines the ease-of-use of a typical jQuery plugin with a powerful cross-platform DHTML cropping engine that is faithful to familiar desktop graphics applications.</p>
<h3 style="color:red;">In conclusion</h3>
<hr />
<p>Although jQuery is a powerful JavaScript framework that can build many flash-like effects, it cannot fully replace Flash. However, jQuery is the stepping stone, helping bring the web closer to HTML5 and wider use of frameworks like <a href="http://cappuccino.org/" rel="nofollow" >Cappuccino</a> (among others) for building non-reliant web applications.</p>
<p>If we are missing anything here, feel free to drop your line to make a friendly conversation. Any comment or suggestion is appreciated!  What do you think? Will Flash last past this next decade?</p>


<p>Related posts:<ol><li><a href='http://aext.net/2009/11/5-fresh-and-useful-jquery-plugins-were-born-in-november-2009/' rel='bookmark' title='Permanent Link: 5 Fresh and Useful jQuery Plugins Were Born in November 2009'>5 Fresh and Useful jQuery Plugins Were Born in November 2009</a></li>
<li><a href='http://aext.net/2009/12/dont-miss-out-latest-10-jquery-plugins-before-closing-the-year-2009/' rel='bookmark' title='Permanent Link: Don&#8217;t Miss Out Latest 10 jQuery Plugins Before Closing The Year 2009'>Don&#8217;t Miss Out Latest 10 jQuery Plugins Before Closing The Year 2009</a></li>
<li><a href='http://aext.net/2009/12/why-do-we-love-these-5-fresh-and-awesome-jquery-plugins/' rel='bookmark' title='Permanent Link: Why Do We Love These 5 Fresh and Awesome jQuery Plugins?'>Why Do We Love These 5 Fresh and Awesome jQuery Plugins?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/03/javascript-jquery-killing-flash-tutorial-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>112</slash:comments>
		</item>
		<item>
		<title>Learning jQuery: Your First jQuery Plugin, &#8220;BubbleUP&#8221;</title>
		<link>http://aext.net/2010/02/learn-jquery-first-jquery-plugin-bubbleup/</link>
		<comments>http://aext.net/2010/02/learn-jquery-first-jquery-plugin-bubbleup/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:02:30 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Bubble Effect]]></category>
		<category><![CDATA[Dock Menu]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Plugin]]></category>
		<category><![CDATA[Learning jQuery]]></category>

		<guid isPermaLink="false">http://aext.net/?p=1746</guid>
		<description><![CDATA[Update: The icons used in this tutorial can be found free here.
There are many posts available detailing how to write your own jQuery plugin. It won&#8217;t take long before you realize that building in jQuery is very simple. Continuing in our jQuery Learning Series, here we&#8217;re going to build your first jQuery plugin. It&#8217;ll generate [...]


Related posts:<ol><li><a href='http://aext.net/2009/11/learning-jquery-horizontal-panel-sliding-with-animate-function/' rel='bookmark' title='Permanent Link: Learning jQuery: Horizontal Panel Sliding With animate() function'>Learning jQuery: Horizontal Panel Sliding With animate() function</a></li>
<li><a href='http://aext.net/2009/12/who-tweet-button-fancy-jquery-plugin-for-twitter/' rel='bookmark' title='Permanent Link: Who-Tweet Button: Fancy jQuery Plugin for Twitter'>Who-Tweet Button: Fancy jQuery Plugin for Twitter</a></li>
<li><a href='http://aext.net/2009/12/why-do-we-love-these-5-fresh-and-awesome-jquery-plugins/' rel='bookmark' title='Permanent Link: Why Do We Love These 5 Fresh and Awesome jQuery Plugins?'>Why Do We Love These 5 Fresh and Awesome jQuery Plugins?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> The icons used in this tutorial can be found free <a href="http://blog.sfaranda.com/free-metallic-social-icons/" rel="nofollow"  target="_blank">here</a>.</p>
<p>There are many posts available detailing how to write your own jQuery plugin. It won&#8217;t take long before you realize that building in jQuery is very simple. Continuing in our jQuery Learning Series, here we&#8217;re going to build your first jQuery plugin. It&#8217;ll generate a bubble effect for your menu list and we&#8217;re going to call it BubbleUP.</p>
<p>What is BubbleUP? BubbleUP is a fun and easy plugin to get you started in jQuery. The effect is a nice starting point for learning the basics and many of the steps involved in creating other more intricate plugins you will make in the future. With this plugin, images in a list will enlarge with a smooth animation when you move your mouse over it. Then, if you move the mouse out, it will reset to the original size with the same smooth animation. </p>
<p><span id="more-1746"></span></p>
<div class="demo-download">
<ul>
<li>
        <a href="http://www.box.net/shared/epyjfrnzev" rel="nofollow"  class="downloadit">Download</a>
      </li>
<li>
        <a href="http://aext.net/jquery-menu-plugin-bubbleup/" class="demoit">Demo</a>
      </li>
</ul>
</div>
<h3>Implement jQuery</h3>
<p>This is a plugin for jQuery, so we first have to implement the jQuery library in our webpage header (you must upload jQuery to your server or link to Google&#8217;s hosted version):</p>
<pre class="js"><span style="color: #881280;">&lt;script </span><span style="color: #994500;">type</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"text/javascript"</span><span style="color: #881280;"> </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"js/jquery-1.3.2.js"</span><span style="color: #881280;">&gt;&lt;/script&gt;</span></pre>
<h3>1. Choose a name</h3>
<p>We will name this plugin as BubbleUP, but feel free to choose another name that suits you better.</p>
<p>In building a jQuery plugin, it&#8217;s recommended you write all the plugin code in one javascript file. Your jQuery plugin&#8217;s file should be named as: <em>[Your-jQuey-Plugin-Name].jQuery.js</em>, but if it&#8217;s too complicated for you, just name it as: <strong>bubbleup.js</strong>.</p>
<p>Now, we&#8217;ll start with a blank javascript file and begin with the following lines (the template for any jQuery plugin):</p>
<pre class="js">(<span style="color: #881350;">function</span>($){
    $.fn.BubbleUP = <span style="color: #881350;">function</span>() {

        <span style="color: #881350;">return</span> <span style="color: #881350;">this</span>.<span style="color: #003369;">each</span>(<span style="color: #881350;">function</span>() {

        });

    };
})(jQuery);</pre>
<p>We named the plugin above &#8220;<em>BubbleUP</em>&#8220;, so we are going to define the name of this plugin by using this code:</p>
<pre class="js">...

    $.fn.BubbleUP = <span style="color: #881350;">function</span>() {

...</pre>
<p>Because we have more than one item in our list, we have to use the each() function to execute the called function for every item in our list.</p>
<p>The first step is finished: creating the jQuery plugin template and naming it.</p>
<h3>2. Implement jQuery Plugin to web page</h3>
<p>Now you need to link the javascript file that you created above into your web page. For this, we&#8217;ll use this code:</p>
<pre class="html"><span style="color: #881280;">&lt;script </span><span style="color: #994500;">type</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"text/javascript"</span><span style="color: #881280;"> </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"js/bubbleup.jquery.js"</span><span style="color: #881280;">&gt;&lt;/script&gt;</span></pre>
<p>To make the plugin work, we need to use this code below. You can insert it anywhere you want as long as it&#8217;s inside the &lt;head&gt; or &lt;body&gt; tags:</p>
<pre class="js">&lt;script type=<span style="color: #760f15;">"text/javascript"</span>&gt;

$(<span style="color: #881350;">function</span>(){

    $(<span style="color: #760f15;">"ul#menu li <strong>img</strong>"</span>).<span style="color: #003369;">bubbleup</span>();

});

&lt;/script&gt;</pre>
<p>As you can see in the demo, we are going to enlarge the image in the list. That&#8217;s why we use images in this menu as target elements.</p>
<h3>3. Animate</h3>
<p>Let&#8217;s write the skeleton of the code.  We&#8217;re going to use the <a href="http://docs.jquery.com/Effects/mouseover" rel="nofollow" >mouseover()</a>, <a href="http://docs.jquery.com/Effects/mouseout" rel="nofollow" >mouseout()</a>, <a href="http://docs.jquery.com/Effects/animate" rel="nofollow" >animate()</a>, and <a href="http://docs.jquery.com/Effects/stop" rel="nofollow" >stop()</a> functions.</p>
<pre class="js">(<span style="color: #881350;">function</span>($){
    $.fn.bubbleup = <span style="color: #881350;">function</span>() {

        <span style="color: #881350;">return</span> <span style="color: #881350;">this</span>.<span style="color: #003369;">each</span>(<span style="color: #881350;">function</span>() {

            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">mouseover</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {

                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">animate</span>({

                        ...

                    });
                }

            ).<span style="color: #003369;">mouseout</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">animate</span>({

                        ...

                    });
                }

            );

        });

    };
})(jQuery);</pre>
<p>This code basically says this: &#8220;Upon mouseover or mouseout, stop any animations that are currently active in this element, and start a new animation (which we&#8217;re going to define later)&#8221;.  We need to immediately stop active animations first to prevent undesirable behavior. This function <a href="http://docs.jquery.com/Effects/stop" rel="nofollow" >stop()</a> will stop the animation before it starts the new animation. The function we are using to generate the smooth bubble effect is <a href="http://docs.jquery.com/Effects/animate" rel="nofollow" >animate()</a>.</p>
<h3>4. Build the menu</h3>
<p>We need to build the menu using HTML. The menu is an unordered list, so it should be something like below. Notice this list has been simplified for this tutorial.</p>
<pre class="html"><span style="color: #881280;">&lt;ul </span><span style="color: #994500;">id</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"menu"</span><span style="color: #881280;">&gt;</span>
  <span style="color: #881280;">&lt;li&gt;</span>
    <span style="color: #881280;">&lt;a </span><span style="color: #994500;">href</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"#"</span><span style="color: #881280;"> </span><span style="color: #994500;">title</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"Full RSS Feed"</span><span style="color: #881280;">&gt;</span>
        <span style="color: #881280;">&lt;img </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"images/rss.png"</span><span style="color: #881280;"> </span><span style="color: #994500;">alt</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"Full RSS Feed"</span><span style="color: #881280;">&gt;</span>
    <span style="color: #881280;">&lt;/a&gt;</span>
  <span style="color: #881280;">&lt;/li&gt;</span>
  <span style="color: #881280;">&lt;li&gt;</span>
    <span style="color: #881280;">&lt;a </span><span style="color: #994500;">href</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"#"</span><span style="color: #881280;"> </span><span style="color: #994500;">title</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"E-Mail Delivery"</span><span style="color: #881280;">&gt;</span>
        <span style="color: #881280;">&lt;img </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"images/email.png"</span><span style="color: #881280;"> </span><span style="color: #994500;">alt</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"E-Mail Delivery"</span><span style="color: #881280;">&gt;</span>
    <span style="color: #881280;">&lt;/a&gt;</span>
  <span style="color: #881280;">&lt;/li&gt;</span>
  <span style="color: #881280;">&lt;li&gt;</span>
    <span style="color: #881280;">&lt;a </span><span style="color: #994500;">href</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"#"</span><span style="color: #881280;"> </span><span style="color: #994500;">title</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"Follow me on Twitter"</span><span style="color: #881280;">&gt;</span>
        <span style="color: #881280;">&lt;img </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"images/twitter.png"</span><span style="color: #881280;"> </span><span style="color: #994500;">alt</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"Follow me on Twitter"</span><span style="color: #881280;">&gt;</span>
    <span style="color: #881280;">&lt;/a&gt;</span>
  <span style="color: #881280;">&lt;/li&gt;</span>
  <span style="color: #881280;">&lt;li&gt;</span>
    <span style="color: #881280;">&lt;a </span><span style="color: #994500;">href</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"#"</span><span style="color: #881280;"> </span><span style="color: #994500;">title</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"I'm on FaceBook"</span><span style="color: #881280;">&gt;</span>
        <span style="color: #881280;">&lt;img </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"images/facebook.png"</span><span style="color: #881280;"> </span><span style="color: #994500;">alt</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"I'm on FaceBook"</span><span style="color: #881280;">&gt;</span>
    <span style="color: #881280;">&lt;/a&gt;</span>
  <span style="color: #881280;">&lt;/li&gt;</span>
  <span style="color: #881280;">&lt;li&gt;</span>
    <span style="color: #881280;">&lt;a </span><span style="color: #994500;">href</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"#"</span><span style="color: #881280;"> </span><span style="color: #994500;">title</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"E-Mail Delivery"</span><span style="color: #881280;">&gt;</span>
        <span style="color: #881280;">&lt;img </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"delicious.png"</span><span style="color: #881280;"> </span><span style="color: #994500;">alt</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"Save it!"</span><span style="color: #881280;">&gt;</span>
    <span style="color: #881280;">&lt;/a&gt;</span>
  <span style="color: #881280;">&lt;/li&gt;</span>
  <span style="color: #881280;">&lt;li&gt;</span>
    <span style="color: #881280;">&lt;a </span><span style="color: #994500;">href</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"#"</span><span style="color: #881280;"> </span><span style="color: #994500;">title</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"E-Mail Delivery"</span><span style="color: #881280;">&gt;</span>
        <span style="color: #881280;">&lt;img </span><span style="color: #994500;">src</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"images/technorati.png"</span><span style="color: #881280;"> </span><span style="color: #994500;">alt</span><span style="color: #881280;">=</span><span style="color: #1a1aa6;">"Favorite this blog"</span><span style="color: #881280;">&gt;</span>
    <span style="color: #881280;">&lt;/a&gt;</span>
  <span style="color: #881280;">&lt;/li&gt;</span>
<span style="color: #881280;">&lt;/ul&gt;</span></pre>
<p>This HTML code is very simple. You need to create just one image for each item and the jQuery plugin will do the rest. The next step is the CSS.</p>
<h3>5. Style the menu (CSS)</h3>
<p>The following CSS is used to style the menu. There are two important things that you should notice: position for <em>&lt;li&gt;</em> elements <strong>must be</strong> set to <em>relative</em> because <em>img</em> elements inside it must be set as <em>absolute</em>. Absolute positioning for an element will not work if the parent is not set as absolute or relative.</p>
<p>The original size of the images is 48px in this tutorial, and the size when enlarged is 96px. That means the images will start animation at 48px and enlarge to 96px. Some margins and padding is in this css code below just make the list display better.</p>
<pre class="css">ul#menu {
    <span style="color: #88134f;">margin</span>: <span style="color: #0000ff;">5px</span> <span style="color: #0000ff;">0px</span>;
}

ul#menu li {
    <span style="color: #88134f;">padding</span>: <span style="color: #0000ff;">0px</span>;
    <span style="color: #88134f;">display</span>: <span style="color: #9b4400;">inline-block</span>;
    *<span style="color: #88134f;">display</span>: <span style="color: #9b4400;">inline</span>; <em><span style="color: #236e25;">/* IE 7 and below */</span></em>
    <span style="color: #88134f;">position</span>: <span style="color: #9b4400;">relative</span>;
    <span style="color: #88134f;">margin-left</span>: <span style="color: #0000ff;">5px</span>;
    <span style="color: #88134f;">margin-right</span>: <span style="color: #0000ff;">5px</span>;
    <span style="color: #88134f;">width</span>: <span style="color: #0000ff;">48px</span>;
    <span style="color: #88134f;">height</span>: <span style="color: #0000ff;">48px</span>;
}

ul#menu li img {
    <span style="color: #88134f;">width</span>: <span style="color: #0000ff;">48px</span>;
    <span style="color: #88134f;">position</span>: <span style="color: #9b4400;">absolute</span>;
    <span style="color: #88134f;">top</span>: <span style="color: #0000ff;">0px</span>;
    <span style="color: #88134f;">left</span>: <span style="color: #0000ff;">0px</span>;
    <span style="color: #88134f;">padding</span>: <span style="color: #0000ff;">0px</span>;
    <span style="color: #88134f;">margin</span>: <span style="color: #0000ff;">0 8px</span> <span style="color: #0000ff;">0 0</span>;
    <span style="color: #88134f;">border</span>: <span style="color: #9b4400;">none</span>;
}</pre>
<h3>6. Create the animations</h3>
<p>This is the main part of this plugin. We will pass some parameters to the animate function.</p>
<p>First, I strongly recommended you re-read one of our previous articles,<a href="http://aext.net/2009/11/bubble-effect-with-css/">Bubble Effect with CSS</a>. When you return to this post, you will understand why we need to enlarge the image and move it up and left the way we are.</p>
<div class="bigimage"><img class="aligncenter size-full wp-image-1764" title="bubble-jquery" src="http://aext.net/wp-contents/uploads/2009/11/bubble-jquery.jpg" alt="bubble-jquery" width="500" height="310" /></div>
<p>As you can see, we need to re-size the images in menu to make it larger. The original size is 48px; the animate function will re-size it to 96px. Take a look in detail at the javascript code below:</p>
<pre class="js">(<span style="color: #881350;">function</span>($){
    $.fn.bubbleup = <span style="color: #881350;">function</span>() {

        <span style="color: #881350;">return</span> <span style="color: #881350;">this</span>.<span style="color: #003369;">each</span>(<span style="color: #881350;">function</span>() {

            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">mouseover</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {

                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">animate</span>({
                        left: <span style="color: #760f15;">"-=24"</span>,
                        top: <span style="color: #760f15;">"-=24"</span>,
                        width: <span style="color: #0000ff;">96</span>
                    }, <span style="color: #760f15;">'fast'</span>);
                }

            ).<span style="color: #003369;">mouseout</span>(

                ...

            );

        });

    };
})(jQuery);</pre>
<p>We will place this image by using negative pixel amounts. The code above will listen for a <a href="http://docs.jquery.com/Events/mouseover" rel="nofollow" >mousehover()</a> event. When the mouse is over the item, the item will be moved diagonally towards to the top left corner by 24 pixels and then also enlarged to 96px.</p>
<p>However, we have a few issues right here. The problem is the action for this image will cover the image next in the list. Thus, we need to set <em>z-index</em> for it by using css. We also need to reset the placements of all the images before and after the animation, because if the animation is not completed and we move the mouse out and over again immediately, the image will be moved once again diagonally towards the top left corner. We must understand that the amount of pixel this image animates base on the current position + <em>(-24px)</em></p>
<p>The complete javascript code that helps the animation to work correctly:</p>
<pre class="js">(<span style="color: #881350;">function</span>($){
    $.fn.bubbleup = <span style="color: #881350;">function</span>() {

        <span style="color: #881350;">return</span> <span style="color: #881350;">this</span>.<span style="color: #003369;">each</span>(<span style="color: #881350;">function</span>() {

            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">mouseover</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {

                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">css</span>({<span style="color: #760f15;">'z-index'</span> : <span style="color: #0000ff;">100</span>, <span style="color: #760f15;">'top'</span> : <span style="color: #0000ff;">0</span>, <span style="color: #760f15;">'left'</span> : <span style="color: #0000ff;">0</span>, <span style="color: #760f15;">'width'</span> : <span style="color: #0000ff;">48</span>}).<span style="color: #003369;">animate</span>({
                        left: <span style="color: #760f15;">"-=24"</span>,
                        top: <span style="color: #760f15;">"-=24"</span>,
                        width: <span style="color: #0000ff;">96</span>
                    }, <span style="color: #760f15;">'fast'</span>);
                }

            ).<span style="color: #003369;">mouseout</span>(

                ...

            );

        });

    };
})(jQuery);</pre>
<p>We do something similar with the <a href="http://docs.jquery.com/Events/mouseout" rel="nofollow" >mouseout()</a> event, but it has a few differences. Of course, the images must be placed back to the original position and re-sized back to the initial size. However, we need to call a new function when the animation is completed. The callback function is used to reset the <em>z-index</em> to the original.</p>
<pre class="js">(<span style="color: #881350;">function</span>($){
    $.fn.bubbleup = <span style="color: #881350;">function</span>() {

        <span style="color: #881350;">return</span> <span style="color: #881350;">this</span>.<span style="color: #003369;">each</span>(<span style="color: #881350;">function</span>() {

            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">mouseover</span>(

                ...

            ).<span style="color: #003369;">mouseout</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">animate</span>({
                        left: <span style="color: #0000ff;">0</span>,
                        top: <span style="color: #0000ff;">0</span>,
                        width: <span style="color: #0000ff;">48</span>
                    }, <span style="color: #760f15;">'fast'</span>, <span style="color: #881350;">function</span>() {
                            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">css</span>({<span style="color: #760f15;">'z-index'</span> : <span style="color: #0000ff;">0</span>});
                        }
                    );
                }

            );

        });

    };
})(jQuery);</pre>
<h3>7. Add option(s)</h3>
<p>I know there some great tutorials out there help you make a jQuery Plugin with options supported, but this one is different. The difference is not the content, because there are many ways to add options to it, it&#8217;s just a change of the code format. The difference here is in the value of this plugin &#8211; it is not <b>just</b> a tutorial, but is actually useful.</p>
<div class="bigimage"><a href="http://aext.net/wp-contents/uploads/2010/01/Bubbleboo2.png"><img class="aligncenter size-full wp-image-2843" title="BubbleUP2" src="http://aext.net/wp-contents/uploads/2010/01/Bubbleboo2.png" alt="" width="500" height="240" /></a></div>
<p>In this part, I will help you add options for your menu BubbleUp. So, stop right here and think about the options we might require. How about the tooltip? We can add the tooltip for this over the top of each item when the mouse is hovering over it. Let&#8217;s begin!</p>
<p>First, write a draft for it, as a template. jQuery plugins should have default options and users will decide to use these options or not. Change the code to this template:</p>
<pre class="js">(<span style="color: #881350;">function</span>($){
    $.fn.bubbleup = <span style="color: #881350;">function</span>(options) {

        <em><span style="color: #236e25;">//Extend the default options of plugin
</span></em>        <span style="color: #881350;">var</span> opts = $.<span style="color: #003369;">extend</span>({}, $.fn.bubbleup.defaults, options);

        <em><span style="color: #236e25;">//Initial the tooltip
</span></em>        <span style="color: #881350;">var</span> tip = null;

        <span style="color: #881350;">return</span> <span style="color: #881350;">this</span>.<span style="color: #003369;">each</span>(<span style="color: #881350;">function</span>() {   

            <em><span style="color: #236e25;">//Set the option value passed here
</span></em>            <span style="color: #881350;">var</span> $tooltip = opts.tooltip; 

            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">mouseover</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {

                    <span style="color: #881350;">if</span>($tooltip) {

                        <em><span style="color: #236e25;">//Display the tooltip
</span></em>                        
                    }               

                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">css</span>({
                        <span style="color: #760f15;">'z-index'</span> : <span style="color: #0000ff;">100</span>,
                        <span style="color: #760f15;">'top'</span> : <span style="color: #0000ff;">0</span>,
                        <span style="color: #760f15;">'left'</span> : <span style="color: #0000ff;">0</span>,
                        <span style="color: #760f15;">'width'</span> : <span style="color: #0000ff;">48</span>
                    }).<span style="color: #003369;">animate</span>({
                        left: <span style="color: #760f15;">"-=24"</span>,
                        top: <span style="color: #760f15;">"-=24"</span>,
                        width: <span style="color: #0000ff;">96</span>
                    }, <span style="color: #760f15;">'fast'</span>);

                }

            ).<span style="color: #003369;">mouseout</span>(

                <span style="color: #881350;">function</span><span style="color: #003369;"> </span>() {

                    <span style="color: #881350;">if</span>($tooltip) {

                        <em><span style="color: #236e25;">//Hide the tooltip
</span></em>                        
                    }           

                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">stop</span>();
                    $(<span style="color: #881350;">this</span>).<span style="color: #003369;">animate</span>({
                        left: <span style="color: #0000ff;">0</span>,
                        top: <span style="color: #0000ff;">0</span>,
                        width: <span style="color: #0000ff;">48</span>
                    }, <span style="color: #760f15;">'fast'</span>, <span style="color: #881350;">function</span>() {
                            $(<span style="color: #881350;">this</span>).<span style="color: #003369;">css</span>({<span style="color: #760f15;">'z-index'</span> : <span style="color: #0000ff;">0</span>});
                        }
                    );
                }

            );

        });

    };

    <em><span style="color: #236e25;">//All default options go here
</span></em>    <em><span style="color: #236e25;">//Must called
</span></em>    $.fn.bubbleup.defaults = {
        tooltip: <span style="color: #881350;">false</span>
    }

})(jQuery);</pre>
<h3>When you mouse-over</h3>
<p>This tooltip will display in the same way as other plugins. When you mouse-over, the tooltip will show up and when the mouse is moved away, the tooltip will be invisible.</p>
<p>Add this code to the <em>mouseover()</em> code block and inside the tooltip is this enabled condition:</p>
<pre class="js"><span style="color: #881350;">if</span>($tooltip) {

    tip = $(<span style="color: #760f15;">'&lt;div&gt;'</span> + $(<span style="color: #881350;">this</span>).<span style="color: #003369;">attr</span>(<span style="color: #760f15;">'alt'</span>) + <span style="color: #760f15;">'&lt;/div&gt;'</span>);

    tip.<span style="color: #003369;">css</span>({
        color: <span style="color: #760f15;">'#333333'</span>,
        fontSize: <span style="color: #0000ff;">12</span>,
        fontWeight: <span style="color: #760f15;">'bold'</span>,
        position: <span style="color: #760f15;">'absolute'</span>,
        zIndex: <span style="color: #0000ff;">100000</span>
    });

    tip.<span style="color: #003369;">remove</span>().<span style="color: #003369;">css</span>({
        top: <span style="color: #0000ff;">0</span>, left: <span style="color: #0000ff;">0</span>,
        visibility: <span style="color: #760f15;">'hidden'</span>,
        display: <span style="color: #760f15;">'block'</span>
    }).<span style="color: #003369;">appendTo</span>(document.body);

  ...

}</pre>
<p>We will not use any external CSS, but instead style the tooltip with JavaScript. This code will create a new tooltip which uses the value of the image&#8217;s <em>alt</em> attribute. We put it in the <em>div</em> tag to display, then put the tip at the end of the HTML document.</p>
<p>Next, we will display the tip:</p>
<pre class="js"><span style="color: #881350;">if</span>($tooltip) {

  ...

    <em><span style="color: #236e25;">//Get the width and height of current image item
</span></em>    <span style="color: #881350;">var</span> position = $.<span style="color: #003369;">extend</span>({}, $(<span style="color: #881350;">this</span>).<span style="color: #003369;">offset</span>(), {
        width: <span style="color: #881350;">this</span>.offsetWidth,
        height: <span style="color: #881350;">this</span>.offsetHeight
    });

    <em><span style="color: #236e25;">//Get the width and height of the tip element                   
</span></em>    <span style="color: #881350;">var</span> tipWidth = tip[<span style="color: #0000ff;">0</span>].offsetWidth,
        tipHeight = tip[<span style="color: #0000ff;">0</span>].offsetHeight;

    <em><span style="color: #236e25;">//Set position for the tip to display correctly
</span></em>    <em><span style="color: #236e25;">//Postion: top and center of image        
</span></em>    tip.<span style="color: #003369;">stop</span>().<span style="color: #003369;">css</span>({
        top: position.top - tipHeight,
        left: position.left + position.width / <span style="color: #0000ff;">2</span> - tipWidth / <span style="color: #0000ff;">2</span>,
        visibility: <span style="color: #760f15;">'visible'</span>
    });

}</pre>
<p>However, our image will scale from small size to big size when we mouse-over. If the tip won&#8217;t move together with the image, then one of them will be covered by the other. The one that would be covered is the one that has the lower value of z-index.</p>
<p>That&#8217;s why we need to animate the tip:</p>
<pre class="js">if($tooltip) {

  ...

   tip.<span style="color: #003369;">animate</span>({
       top: <span style="color: #760f15;">"-=24"</span>,
   }, <span style="color: #760f15;">'fast'</span>);

}</pre>
<h3>When the mouse is away</h3>
<p>When the mouse is away, the code is very simple. We just need make the tip visible. However, we should remove it then create and create another one when the mouse is over it again. That&#8217;s better than just setting it to be invisible.</p>
<pre class="js"><span style="color: #881350;">if</span>($tooltip) {
    tip.<span style="color: #003369;">remove</span>();
}</pre>
<h3>You&#8217;re done!</h3>
<p>That&#8217;s all you need to make a jQuery plugin!</p>
<div class="demo-download">
<ul>
<li>
        <a href="http://www.box.net/shared/epyjfrnzev" rel="nofollow"  class="downloadit">Download</a>
      </li>
<li>
        <a href="http://aext.net/jquery-menu-plugin-bubbleup/" class="demoit">Demo</a>
      </li>
</ul>
</div>
<p>Please understand that this is just a basic version of BubbleUP and it still has some issues. If we are going to create a complete jQuery plugin, we should do more. Creating a jQuery plugin by yourself is very easy if you know the basics of jQuery, and it is easier if you are creating a practical plugin, like BubbleUP, to understand the steps.</p>
<p>Are you going to use it on your site? It is quite a smooth and simple menu, isn&#8217;t it? Tell us how you&#8217;re using it on your website in the comments and don&#8217;t forget to <a href="http://feeds2.feedburner.com/prlamnguyen" rel="nofollow" >subscribe to the feed</a>!</p>


<p>Related posts:<ol><li><a href='http://aext.net/2009/11/learning-jquery-horizontal-panel-sliding-with-animate-function/' rel='bookmark' title='Permanent Link: Learning jQuery: Horizontal Panel Sliding With animate() function'>Learning jQuery: Horizontal Panel Sliding With animate() function</a></li>
<li><a href='http://aext.net/2009/12/who-tweet-button-fancy-jquery-plugin-for-twitter/' rel='bookmark' title='Permanent Link: Who-Tweet Button: Fancy jQuery Plugin for Twitter'>Who-Tweet Button: Fancy jQuery Plugin for Twitter</a></li>
<li><a href='http://aext.net/2009/12/why-do-we-love-these-5-fresh-and-awesome-jquery-plugins/' rel='bookmark' title='Permanent Link: Why Do We Love These 5 Fresh and Awesome jQuery Plugins?'>Why Do We Love These 5 Fresh and Awesome jQuery Plugins?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/02/learn-jquery-first-jquery-plugin-bubbleup/feed/</wfw:commentRss>
		<slash:comments>80</slash:comments>
		</item>
		<item>
		<title>How to Pull Your Google Buzz with jQuery</title>
		<link>http://aext.net/2010/02/pull-google-buzz-with-jquery/</link>
		<comments>http://aext.net/2010/02/pull-google-buzz-with-jquery/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 23:51:19 +0000</pubDate>
		<dc:creator>Mike More</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[buzz]]></category>
		<category><![CDATA[content distribution network]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google buzz]]></category>
		<category><![CDATA[implementation steps]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript solutions]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://aext.net/?p=3825</guid>
		<description><![CDATA[<p>So you just got into <a href="http://www.google.com/buzz">Google Buzz</a> few days ago and would like to embed your buzz stream into a website yourself. Here are a few jQuery lines to help you get started.</p>

<p>Pure Javascript solutions usually incorporate the JSON format [<a href="http://www.json.org/fatfree.html">The Fat-Free Alternative to XML</a>] since it is lightweight, very easy to traverse. However, since Google Buzz was launched last Tuesday they still haven't offered a JSON format of the Buzz feed yet.</p>

<p>
<a href="http://code.google.com/apis/buzz/documentation/#syndication">Google Buzz API</a> provides your buzz stream in Atom format. But, under the &#34;<a href="http://en.wikipedia.org/wiki/Same_origin_policy">same origin policy</a>&#34; you can't pull data (like Atom) from another domain without using JSONP [<a href="http://en.wikipedia.org/wiki/JSON#JSONP">a complement to the base JSON data format</a>]. So, that's when another Google service comes to the rescue: <a href="http://code.google.com/apis/ajaxfeeds/">Google AJAX Feed API</a>, a proxy that downloads your Atom/RSS feed and converts it into <a href="http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON">JSON</a> format. </p>

<div class="bigimage"><a href="http://aext.net/example/jquery-buzz/"><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-16-at-12.23.06-AM.png" alt="" title="Pull Google Buzz with jQuery" width="500" height="300" class="aligncenter size-full wp-image-3843" /></a></div>

<p style="text-align:center"><b><a href="http://aext.net/example/jquery-buzz/">View DEMO</a></b></p>


Related posts:<ol><li><a href='http://aext.net/2010/02/12-undocumented-tricks-for-google-buzz/' rel='bookmark' title='Permanent Link: 12 Undocumented Tricks for Google Buzz'>12 Undocumented Tricks for Google Buzz</a></li>
<li><a href='http://aext.net/2010/02/google-buzz-tips-resources-icons/' rel='bookmark' title='Permanent Link: More Google Buzz Tips, Resources, Extensions, and Icons to Keep You Buzzed.'>More Google Buzz Tips, Resources, Extensions, and Icons to Keep You Buzzed.</a></li>
<li><a href='http://aext.net/2009/09/learning-jquery-submit-form-php-mac-style-modal-window/' rel='bookmark' title='Permanent Link: Learning jQuery: Submit form PHP Mac style Modal window'>Learning jQuery: Submit form PHP Mac style Modal window</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So you just got into <a href="http://www.google.com/buzz" rel="nofollow" >Google Buzz</a> few days ago and would like to embed your buzz stream into a website yourself. Here are a few jQuery lines to help you get started.</p>
<p><span id="more-3825"></span></p>
<p>Pure Javascript solutions usually incorporate the JSON format [<a href="http://www.json.org/fatfree.html" rel="nofollow" >The Fat-Free Alternative to XML</a>] since it is lightweight, very easy to traverse. However, since Google Buzz was launched last Tuesday they still haven&#8217;t offered a JSON format of the Buzz feed yet.</p>
<p>
<a href="http://code.google.com/apis/buzz/documentation/#syndication" rel="nofollow" >Google Buzz API</a> provides your buzz stream in Atom format. But, under the &quot;<a href="http://en.wikipedia.org/wiki/Same_origin_policy" rel="nofollow" >same origin policy</a>&quot; you can&#8217;t pull data (like Atom) from another domain without using JSONP [<a href="http://en.wikipedia.org/wiki/JSON#JSONP" rel="nofollow" >a complement to the base JSON data format</a>]. So, that&#8217;s when another Google service comes to the rescue: <a href="http://code.google.com/apis/ajaxfeeds/" rel="nofollow" >Google AJAX Feed API</a>, a proxy that downloads your Atom/RSS feed and converts it into <a href="http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON" rel="nofollow" >JSON</a> format. </p>
<div class="bigimage"><a href="http://aext.net/example/jquery-buzz/"><img src="http://aext.net/wp-contents/uploads/2010/02/Screen-shot-2010-02-16-at-12.23.06-AM.png" alt="" title="Pull Google Buzz with jQuery" width="500" height="300" class="aligncenter size-full wp-image-3843" /></a></div>
<p style="text-align:center"><b><a href="http://aext.net/demo-how-to-pull-your-google-buzz-with-jquery/">View DEMO</a></b></p>
<p><!-- more --></p>
<p>Now let&#8217;s go through the implementation steps:</p>
<h3>1. CSS First</h3>
<hr />
<p>
Buzzes will be added as unordered list. So, these are few CSS lines to clear margin and padding on the unordered list element and style buzz items to looks like rows.
</p>
<pre class="css">
/* ul list */
ul.gb{
&nbsp;&nbsp;&nbsp;padding:0;
&nbsp;&nbsp;&nbsp;margin:0;
}

ul.gb li{
&nbsp;&nbsp;&nbsp;border-bottom:silver 1px solid;
&nbsp;&nbsp;&nbsp;float:left;
&nbsp;&nbsp;&nbsp;margin:1px 0 1px 0;
&nbsp;&nbsp;&nbsp;padding:2px;
&nbsp;&nbsp;&nbsp;list-style-type:none;
&nbsp;&nbsp;&nbsp;height:48px;
&nbsp;&nbsp;&nbsp;overflow:hidden;
&nbsp;&nbsp;&nbsp;width:100%;
}
/* Buzz date */
ul.gb span.gb-meta {
&nbsp;&nbsp;&nbsp;display:block;
&nbsp;&nbsp;&nbsp;margin:3px 0 0 0;
}
ul.gb span.gb-meta a{
&nbsp;&nbsp;&nbsp;font-size:95%;
&nbsp;&nbsp;&nbsp;color:green;
&nbsp;&nbsp;&nbsp;text-decoration:none;
}
</pre>
<h3>2. Include jQuery</h3>
<hr />
<p>
We&#8217;ll include jQuery library from Google&#8217;s high speed <a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery" rel="nofollow" >content distribution network</a>.
</p>
<pre class="html">
&lt;script type=&quot;text/javascript&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<h3>3. Call When Ready</h3>
<hr />
<p>Then call the jQuery function when &quot;<a href="http://api.jquery.com/ready/" rel="nofollow" >document ready</a>&quot;, to start executing the function when the DOM is fully loaded. This will ensure that Javascript will find the referenced HTML elements.
</p>
<pre class="javascript">
$(document).ready(function(){
&nbsp;&nbsp;&nbsp;getGoogleBuzz('mikedotmore', 5, $('#my-buzz'));
});
</pre>
<p>The function takes 3 parameters: Google username, Number of entries to return, and jQuery Object of the placeholder.</p>
<h3>4. The Function&#8217;s Process&#8230;</h3>
<hr />
<ol>
<li>The function code starts by specifying few parameters for the Google Feed API as such: getGoogleBuzz( &#8216;<u>Buzz feed username</u>&#8216; , <u>number of entries</u> , $(&#8216;#<u>id of placeholder</u>&#8216;) );</li>
<li>Call jQuery <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow" >AJAX</a> function and define a function to be called when the <a href="http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON" rel="nofollow" >JSON</a> data is returned.</li>
<li>Show error message if Google Feed API couldn&#8217;t retrieve the Buzz stream.</li>
<li>Append a hidden unordered-list to the placeholder. </li>
<li>Loop each Buzz entry of the entries array, and&#8230;
<ul>
<li>Parse publishedDate into a Date object.</li>
<li>Convert links that start with &quot;http&quot; or &quot;https&quot; into hyperlinks.</li>
<li>Append List item element with Buzz content.</li>
</ul>
</li>
</ol>
<pre class="javascript">
<span style="color:#881350;">function</span> <span style="color:#003369;">getGoogleBuzz</span>(username,n, div){
&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// params for Google Feed API proxy : Buzz Feed URL, Number of Entries 
</span></em>&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> data = {q:<span style="color:#760f15;">'http://buzz.googleapis.com/feeds/'</span>+username+<span style="color:#760f15;">'/public/posted'</span> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,num:n
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,output:<span style="color:#760f15;">'json'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,v:<span style="color:#760f15;">'1.0'</span>};
&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// call Google Feed API
</span></em>&nbsp;&nbsp;&nbsp;$.<span style="color:#003369;">ajax</span>({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url:<span style="color:#760f15;">'http://ajax.googleapis.com/ajax/services/feed/load'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,data:data
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,dataType:<span style="color:#760f15;">'jsonp'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,success:<span style="color:#881350;">function</span>(json){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// json from Google Feed API was returned successfully..
</span></em>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// error with Google Buzz feed ?
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span>(json.responseStatus!=<span style="color:#0000ff;">200</span>) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;div.<span style="color:#003369;">html</span>(<span style="color:#760f15;">'&lt;b style=&quot;color:red&quot;&gt;'</span>+ json.responseDetails +<span style="color:#760f15;">'&lt;/b&gt;'</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">return</span>; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// Buzz entries array
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> entries= json.responseData.feed.entries;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> length= entries.length;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// no entries!
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span>(length==<span style="color:#0000ff;">0</span>) <span style="color:#881350;">return</span>; 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// start output by appendding a hidden unordered list
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> ul = $(<span style="color:#760f15;">'&lt;ul class=&quot;gb&quot; style=&quot;display:none&quot;&gt;&lt;/ul&gt;'</span>).<span style="color:#003369;">appendTo</span>(div.<span style="color:#003369;">html</span>(<span style="color:#760f15;">''</span>));

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// loop buzz entries
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">for</span>(<span style="color:#881350;">var</span> i=<span style="color:#0000ff;">0</span>; i&lt;length; i++){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// parse published-date string
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> pDate = <span style="color:#881350;">new</span> <span style="color:#003369;">Date</span>(entries[i].publishedDate);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// using entry snippet version
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> snippet = entries[i].contentSnippet;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// convert links that start with http to hyperlinks using regular expression
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;snippet = snippet.<span style="color:#003369;">replace</span>(<span style="color:#661aa9;">/</span><span style="color:#be73fd;">\b</span><span style="color:#661aa9;">(https?</span><span style="color:#be73fd;">\:\/\/\S</span><span style="color:#661aa9;">+)/gi</span>,<span style="color:#760f15;">' &lt;a href=&quot;$1&quot;&gt;$1&lt;/a&gt;'</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// append buzz to UL
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ul.<span style="color:#003369;">append</span>(<span style="color:#760f15;">'&lt;li&gt;'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+<span style="color:#760f15;">'&lt;span class=&quot;gb-content&quot;&gt;'</span>+ snippet +<span style="color:#760f15;">'&lt;/span&gt;'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+<span style="color:#760f15;">'&lt;span class=&quot;gb-meta&quot;&gt;'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span style="color:#760f15;">'&lt;a href=&quot;'</span>+ entries[i].link +<span style="color:#760f15;">'&quot;&gt;'</span>+ pDate.<span style="color:#003369;">toLocaleString</span>() +<span style="color:#760f15;">'&lt;/a&gt;'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+<span style="color:#760f15;">'&lt;/span&gt;'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+<span style="color:#760f15;">'&lt;/li&gt;'</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// now show-in the unordered list
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ul.<span style="color:#003369;">show</span>(<span style="color:#760f15;">'slow'</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;});
}
</pre>
<h3>5. Add a Placeholder</h3>
<hr />
<p>
This is the div element that will hold your buzzes with id set to <b>&quot;my-buzz&quot;</b>
</p>
<pre class="html">
&lt;div id=&quot;my-buzz&quot;&gt;loading...&lt;/div&gt;
</pre>
<p style="text-align:center"><b><a href="http://aext.net/demo-how-to-pull-your-google-buzz-with-jquery/">View DEMO</a></b></p>
<p>Be alert though! Google Buzz is still brand new, and the rules of the game may be changed later. So, stay tuned&#8230;  </p>


<p>Related posts:<ol><li><a href='http://aext.net/2010/02/12-undocumented-tricks-for-google-buzz/' rel='bookmark' title='Permanent Link: 12 Undocumented Tricks for Google Buzz'>12 Undocumented Tricks for Google Buzz</a></li>
<li><a href='http://aext.net/2010/02/google-buzz-tips-resources-icons/' rel='bookmark' title='Permanent Link: More Google Buzz Tips, Resources, Extensions, and Icons to Keep You Buzzed.'>More Google Buzz Tips, Resources, Extensions, and Icons to Keep You Buzzed.</a></li>
<li><a href='http://aext.net/2009/09/learning-jquery-submit-form-php-mac-style-modal-window/' rel='bookmark' title='Permanent Link: Learning jQuery: Submit form PHP Mac style Modal window'>Learning jQuery: Submit form PHP Mac style Modal window</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/02/pull-google-buzz-with-jquery/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>CSS text-indent: An Excellent Trick To Style Your HTML Form</title>
		<link>http://aext.net/2010/02/css-text-indent-style-your-html-form/</link>
		<comments>http://aext.net/2010/02/css-text-indent-style-your-html-form/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 05:57:12 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS & XHTML]]></category>
		<category><![CDATA[CSS Design]]></category>
		<category><![CDATA[css example]]></category>
		<category><![CDATA[CSS Trick]]></category>
		<category><![CDATA[CSS tutorial]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[text-indent]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://aext.net/?p=3127</guid>
		<description><![CDATA[You properly know exactly what the property text-indent does in our css style. It's just a common property of css that everybody using everyday to hide the text in link block. Sure, text-indent is doing it well. However, it does not only just hide the text. It does more.


Related posts:<ol><li><a href='http://aext.net/2008/12/improve-your-css-skill-right-now/' rel='bookmark' title='Permanent Link: Improve your css skill, right now!'>Improve your css skill, right now!</a></li>
<li><a href='http://aext.net/2009/12/wordpress-theme-from-scratch-%e2%80%93-day-2-psd-to-html/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 2: PSD to HTML'>WordPress Theme from Scratch – Day 2: PSD to HTML</a></li>
<li><a href='http://aext.net/2009/10/css-absolute-positioning-create-a-fancy-link-block/' rel='bookmark' title='Permanent Link: CSS Absolute Positioning: Create A Fancy Link Block'>CSS Absolute Positioning: Create A Fancy Link Block</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You probably know what the text-indent property does in CSS. It's a common CSS property allowing webmasters to indent paragraphs and hide text for image-based links. Text-indent does this great; however, it doesn't just hide and indent text. It does more.</p>

<span id="more-3127"></span>

<h3>What's text-indent?</h3>
<hr />
<p>Text-indent specifies the horizontal indent from the left side of the parent block element for the first line in the block. The indent is only applied at the beginning of the block but not after any intervening line-breaking elements. Keep in mind that this property allows negative values, and if used this way, the first line will be indented to the left.</p>

<p>The text-indent property is supported in all major browsers. However, Internet Explorer fails to support the inherit value for the text-indent (Yes, even IE8).</p>

<h3>Hiding text using text-indent</h3>
<hr />

<p>Let's say you have a logo and you want to display it in a link, so people can click on it.  Only including the image of the logo has some drawbacks as far as SEO is concerned.  Here's a solution to handle this:</p>

<pre class="html">
&lt;style type=&quot;text/css&quot;&gt; 

h1 a {
&nbsp;&nbsp;&nbsp;&nbsp;text-decoration: none;
&nbsp;&nbsp;&nbsp;&nbsp;position: absolute; /* Depending on your placement */
&nbsp;&nbsp;&nbsp;&nbsp;width: 260px;
&nbsp;&nbsp;&nbsp;&nbsp;height: 100px;
&nbsp;&nbsp;&nbsp;&nbsp;bottom: 0px; /* Depending on your placement */
&nbsp;&nbsp;&nbsp;&nbsp;background: url(images/aext-logo.png) no-repeat left top;
&nbsp;&nbsp;&nbsp;&nbsp;text-indent: -99999px;
}

&lt;/style&gt;

&lt;h1&gt;&lt;a href=&quot;http://aext.net&quot;&gt;AEXT.NET&lt;/a&gt;&lt;/h1&gt;
</pre>

<p>With this, search engines will still recognize the text, but users will only see the logo because the text is indented to the left (99999px).  See:</p>

[inline]
<style type="text/css"> 

div#demo1 {
	clear: both;
	margin: 20px 0;
	overflow: hidden;
}

div#demo1 h1 {
	float: left;
} 

div#demo1 h1 a {
	display: block;
	text-decoration: none;
	width: 260px;
	height: 74px;
	background: url(http://aext.net/wp-contents/uploads/2010/01/aext-logo.png) no-repeat left top;
	text-indent: -99999px;
}


</style>
[/inline]


<div id="demo1">
<h1><a href="http://aext.net">AEXT.NET</a></h1>
</div>

<p> This is not a new CSS technique and probably one of the most widely used techniques today. The way it works is very simple: the text in any block (not just links; such block-level elements, table cells, and inline blocks) will be pushed so far to the left (off screen) that its background image will remain the only thing the user see. The value of the text-indent property tells the browser at what point, relatively, the text should start.</p>

<h3>An awesome trick using text-indent &amp; forms</h3>
<hr />

<p>People mostly use text-indent to hide text like our example above. They often use the negative value for text-indent but forget to make use of its original intent: inset indentation. Here I'll show you how to make a beautiful text field using text-indent.</p>

<p>Let's use a simple search form as an example:</p>

<pre class="html">
&lt;form action=&quot;http://aext.net&quot; id=&quot;search&quot; method=&quot;get&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;fieldset&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;text&quot; id=&quot;searchtxt&quot; name=&quot;s&quot; value=&quot;&quot;&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fieldset&gt;
&lt;/form&gt;
</pre>

<p>Before the CSS, your text field looks something like this:</p>

[inline]
<style type="text/css">

div#demo2 {
	clear: both;
	margin: 20px 0;
	overflow: hidden;
}

</style>

<div id="demo2">
<form action="http://aext.net" id="search" method="get">
	<fieldset> 
		<label for="searchtxt">Enter your keyword: </label>
		<input type="text" id="searchtxt" name="s" value=""/> 
	</fieldset>
</form>
</div>
[/inline]

<p>First, let's style it up and make it look a bit better with this CSS:</p>

<pre class="html">
&lt;style type=&quot;text/css&quot;&gt;

fieldset {
&nbsp;&nbsp;&nbsp;&nbsp;border: none;
}

label
{
&nbsp;&nbsp;&nbsp;&nbsp;font-family: Helvetica,arial,sans-serif;
&nbsp;&nbsp;&nbsp;&nbsp;font-size: 15px;
&nbsp;&nbsp;&nbsp;&nbsp;font-weight: bold;
&nbsp;&nbsp;&nbsp;&nbsp;color: #9F0000;
}

input[type=&quot;text&quot;]
{
&nbsp;&nbsp;&nbsp;&nbsp;border:1px solid #CCCCCC;
&nbsp;&nbsp;&nbsp;&nbsp;color:#516064;
&nbsp;&nbsp;&nbsp;&nbsp;font-family: Helvetica,arial,sans-serif;
&nbsp;&nbsp;&nbsp;&nbsp;font-size:16px;
&nbsp;&nbsp;&nbsp;&nbsp;margin-bottom:20px;
&nbsp;&nbsp;&nbsp;&nbsp;padding:8px;
&nbsp;&nbsp;&nbsp;&nbsp;width:400px;
}
&lt;/style&gt;

&lt;form action=&quot;http://aext.net&quot; id=&quot;search&quot; method=&quot;get&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;fieldset&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;label for=&quot;searchtxt&quot;&gt;Search: &lt;/label&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;text&quot; id=&quot;searchtxt&quot; name=&quot;s&quot; value=&quot;&quot;/&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fieldset&gt;
&lt;/form&gt;
</pre>

<p>The result?</p>

[inline]
<style type="text/css">

div#demo3 {
	clear: both;
	margin: 20px 0;
	overflow: hidden;
}

div#demo3 fieldset {
	border: none;
}

div#demo3 label
{
    font-family: Helvetica,arial,sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #9F0000;
}

div#demo3 input[type="text"]
{
	border:1px solid #CCCCCC;
	display: block;
	color:#516064;
	font-family: Helvetica,arial,sans-serif;
	font-size:16px;
	margin-bottom:20px;
	padding:8px;
	width:400px;
}
</style>

<div id="demo3">
<form action="http://aext.net" id="search2" method="get">
	<fieldset> 
		<label for="searchtxt2">Search: </label>
		<input type="text" id="searchtxt2" name="s" value=""/> 
	</fieldset>
</form>
</div>
[/inline]

<p>The label is now above the input field but it'd look amazing if we wrapped it with the input element and made the entered text follow after the label. We'd usually do it with the padding value, but today we'll do it with text-indent.</p>

<p>Alright, now for the trick!  Here it is:</p>

<pre class="html">
&lt;style type=&quot;text/css&quot;&gt;

fieldset {
&nbsp;&nbsp;&nbsp;&nbsp;border: none;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;/* trick */
&nbsp;&nbsp;&nbsp;&nbsp;position: relative;
}

label
{
&nbsp;&nbsp;&nbsp;&nbsp;font-family: Helvetica,arial,sans-serif;
&nbsp;&nbsp;&nbsp;&nbsp;font-size: 15px;
&nbsp;&nbsp;&nbsp;&nbsp;font-weight: bold;
&nbsp;&nbsp;&nbsp;&nbsp;color: #9F0000;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;/* trick */
&nbsp;&nbsp;&nbsp;&nbsp;left:10px;
&nbsp;&nbsp;&nbsp;&nbsp;top:9px;
&nbsp;&nbsp;&nbsp;&nbsp;position:absolute;
}

input[type=&quot;text&quot;]
{
&nbsp;&nbsp;&nbsp;&nbsp;border:1px solid #CCCCCC;
&nbsp;&nbsp;&nbsp;&nbsp;display: block;
&nbsp;&nbsp;&nbsp;&nbsp;color:#516064;
&nbsp;&nbsp;&nbsp;&nbsp;font-family: Helvetica,arial,sans-serif;
&nbsp;&nbsp;&nbsp;&nbsp;font-size:16px;
&nbsp;&nbsp;&nbsp;&nbsp;margin-bottom:20px;
&nbsp;&nbsp;&nbsp;&nbsp;padding:8px;
&nbsp;&nbsp;&nbsp;&nbsp;width:400px;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;/* trick */
&nbsp;&nbsp;&nbsp;&nbsp;text-indent:75px;
}
&lt;/style&gt;

&lt;form action=&quot;http://aext.net&quot; id=&quot;search&quot; method=&quot;get&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;fieldset&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;label for=&quot;searchtxt&quot;&gt;Search: &lt;/label&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- Remember to set mexlength for the input --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;text&quot; id=&quot;searchtxt&quot; name=&quot;s&quot; value=&quot;&quot; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxlength=&quot;35&quot; /&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fieldset&gt;
&lt;/form&gt;
</pre>

<p>What you get after the trick:</p>

[inline]
<style type="text/css">

div#demo4 {
	clear: both;
	margin: 20px 0;
	overflow: hidden;
}

div#demo4 fieldset {
	border: none;
	position: relative;
}

div#demo4 label
{
    font-family: Helvetica,arial,sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #9F0000;
    padding:0;
    left:10px;
	top:9px;
	position:absolute;
}

div#demo4 input[type="text"]
{	
	display:block; 
	line-height: 100%;
	border:1px solid #CCCCCC;
	display: block;
	color:#516064;
	font-family: Helvetica,arial,sans-serif;
	font-size:16px;
	margin-bottom:20px;
	padding:8px;
	width:400px;
	text-indent:75px;
}
</style>

<div id="demo4">
<form action="http://aext.net" id="search4" method="get">
	<fieldset> 
		<label for="searchtxt4">Search: </label>
		<input type="text" id="searchtxt4" name="s" value="" maxlength="35" /> 
	</fieldset>
</form>
</div>
[/inline]

<p>Although it looks great &amp; works perfectly, you <em>need</em> to set the maxlength value for the input element to avoid text moving to left and getting in the way of the label.  Here's a sample of how you could use this technique in the &quot;real world&quot;:</p>

[inline]
<style type="text/css">

div#demo5 {
	clear: both;
	margin: 20px 0;
	overflow: hidden;
}

div#demo5 h4 {
font-family:Georgia,"Times New Roman",Times,serif;
font-size:1.5em;
font-weight:normal;
letter-spacing:-1px;
line-height:120%;
padding:7px 0;
margin:0;
}

div#demo5 fieldset {
	border: none;
	position: relative;
}

div#demo5 label
{
    font-family: Helvetica,arial,sans-serif;
    font-size: 16px;
	color:#516064;
    left:10px;
	top:8px;
	position:absolute;
}

div#demo5 input[type="text"]
{	display:block; 
	line-height: 100%;
	-moz-border-radius-bottomleft:6px;
	-moz-border-radius-bottomright:6px;
	-moz-border-radius-topleft:6px;
	-moz-border-radius-topright:6px;
	border:1px solid #CCCCCC;
	display: block;
	color:#9F0000;
	font-family: Helvetica,arial,sans-serif;
	font-size:16px;
	margin-bottom:20px;
	padding:8px;
	width:400px;
	text-indent:175px;
}
</style>

<div id="demo5">
<h4>Choose an username for your portfolio:</h4>
<form action="http://aext.net" id="search5" method="get">
	<fieldset> 
		<label for="searchtxt5">http://whofreelance.com/</label>
		<input type="text" id="searchtxt5" name="s" value="lamnguyen" maxlength="20" /> 
	</fieldset>
</form>
</div>
[/inline]

<p><strong>Updated:</strong> <del datetime="2010-02-04T10:54:33+00:00">It will display incorrectly in IE6 & IE7 because the css in this tutorial conflicts with the css in this WordPress theme. It works well in its own page.</del> There is a bug in IE with the input element by using text-indent that I forgot. That's "Peekaboo Bug". It will make the text inside the text input display weird by floating to the left, but when refreshed, the bug is gone. Alright, edit something in your css text field:</p>

<pre class="html">
&lt;style type=&quot;text/css&quot;&gt;

input[type=&quot;text&quot;]
{ &nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;display:block; 
&nbsp;&nbsp;&nbsp;&nbsp;line-height: 100%;
}

&lt;/style&gt;
</pre>

<p>So, what do you think? If you find any issues in this tutorial, please drop a line in comment section! Hope you like it and be sure to spread the love by sharing this article with the buttons below. Thanks!</p>

<p>Related posts:<ol><li><a href='http://aext.net/2008/12/improve-your-css-skill-right-now/' rel='bookmark' title='Permanent Link: Improve your css skill, right now!'>Improve your css skill, right now!</a></li>
<li><a href='http://aext.net/2009/12/wordpress-theme-from-scratch-%e2%80%93-day-2-psd-to-html/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 2: PSD to HTML'>WordPress Theme from Scratch – Day 2: PSD to HTML</a></li>
<li><a href='http://aext.net/2009/10/css-absolute-positioning-create-a-fancy-link-block/' rel='bookmark' title='Permanent Link: CSS Absolute Positioning: Create A Fancy Link Block'>CSS Absolute Positioning: Create A Fancy Link Block</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/02/css-text-indent-style-your-html-form/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>How To Wrap Google Adsense In Wordpress Posts Correctly</title>
		<link>http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/</link>
		<comments>http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 06:57:00 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WordPress Hack]]></category>
		<category><![CDATA[WordPress Tips]]></category>

		<guid isPermaLink="false">http://aext.net/?p=3010</guid>
		<description><![CDATA[It's easy to add Google Adsense code in the top, the bottom of WordPress posts by edit your WordPress theme posts file. However, sometime you need to wrap Google Adsense code in WordPress posts, and you can not do as the same way as add it on top, bottom. This article will explain you how to do that.


Related posts:<ol><li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
<li><a href='http://aext.net/2009/12/10-useful-code-snippets-and-plugins-to-spice-up-wordpress-avatar/' rel='bookmark' title='Permanent Link: 10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar'>10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar</a></li>
<li><a href='http://aext.net/2010/01/the-right-way-to-build-wordpress-as-a-community-news/' rel='bookmark' title='Permanent Link: The Right Way To Build WordPress As A Community News'>The Right Way To Build WordPress As A Community News</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[It's easy to add Google Adsense code in the top, the bottom of WordPress posts by edit your WordPress theme posts file. However, sometime you need to wrap Google Adsense code in WordPress posts, and you can not do as the same way as add it on top, bottom. This article will explain you how to do that.

<span id="more-3010"></span>

For coupe of months ago, I published a post <a href="http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/">Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a>. With that tutorial, you can add anything in WordPress posts on top, bottom before other plugins do, even right below the post excerpt.

Updated: Thanks to <a href="http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/comment-page-1/#comment-4234">Jonathan Foucher</a> and <a href="http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/comment-page-1/#comment-4236">Nathan J. Brauer</a> for notify me the replacement function. I need to visit more often on php manual site.

<h3>1. Replacement using str_replace() function</h3>

The only one way for you to insert Google Adsense or anything in WordPress Posts is using str_replace() function to scan the whole content for the string like <em>&lt;!-googlead-&gt;</em> then replace it by the Google Adsense code.

First, create a function like this one below in functions.php file:

<pre class="php">
function googleadsense($content){
&nbsp;&nbsp;
&nbsp;&nbsp;$adsensecode = 'GOOGLE ADSENSE GOES HERE';
&nbsp;&nbsp;
&nbsp;&nbsp;$pattern = '&lt;!-googlead-&gt;';
&nbsp;&nbsp;
&nbsp;&nbsp;$content = str_replace($pattern, $adsensecode, $content);
&nbsp;&nbsp;
&nbsp;&nbsp;return $content; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}

add_filter('the_content', 'googleadsense');
</pre>

That's all you need. Now, whenever you publish a post, insert <em>&lt;!-googlead-&gt;</em> in post content where you want Google Adsense to be displayed.



<h3>2. Using Shortcode API</h3>

From version 2.5.1, WordPress has supported <strong>Shortcode API</strong>, a simple set of functions for creating macro codes for use in post content. We need to write a function which is a shortcode handler function in funtions.php file. The return value of a shortcode handler function is inserted into the post content output in place of the shortcode macro.

In this case, we will use the shortcode <em>[googlead]</em> to insert Google Adsense code in WordPress post. All the code we need is:

<pre class="php">
function googlead_shortcode() {

&nbsp;&nbsp;$adsensecode = 'GOOGLE ADSENSE SHORCODE GOES HERE';
&nbsp;&nbsp;
&nbsp;&nbsp;return $adsensecode;
}

add_shortcode('googlead', 'googlead_shortcode');
</pre>

Refer to the code above, when the_content is displayed, the shortcode API will parse any registered shortcodes such as <em>[googlead]</em>. The return (Google Adsense code) by the shortcode handler will be inserted into the post body in place of the shortcode [googlead] itself. 

In my conclusion, these two code snippets above is the simplest and easiest to insert wrap Google Adsense code in WordPress posts. However, you sometime need to change the Google Adsense code to display, you should use the WordPress Option value for Google Adsense code instead of adding the ad code in functions.php file. Have you tried to add options for your WordPress theme before? If not, please take a look at this post: <a href="http://aext.net/2009/10/wordpress-theme-design-with-options-adminstration/">Wordpress Theme Design with Options Adminstration</a>. Hope this post is useful for you!

<p>Related posts:<ol><li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
<li><a href='http://aext.net/2009/12/10-useful-code-snippets-and-plugins-to-spice-up-wordpress-avatar/' rel='bookmark' title='Permanent Link: 10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar'>10 Useful Code Snippets And Plugins To Spice Up Wordpress Avatar</a></li>
<li><a href='http://aext.net/2010/01/the-right-way-to-build-wordpress-as-a-community-news/' rel='bookmark' title='Permanent Link: The Right Way To Build WordPress As A Community News'>The Right Way To Build WordPress As A Community News</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>WordPress Theme from Scratch – Day 3: HTML to WordPress</title>
		<link>http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/</link>
		<comments>http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 09:52:39 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Popular]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Theme Design]]></category>
		<category><![CDATA[theme developement]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress development]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://aext.net/?p=2571</guid>
		<description><![CDATA[This tutorial is in the series of “WordPress Theme from Scratch” that helps you build a WordPress theme by yourself from nothing. Previous tutorial in this series helped we convert a mockup in PSD to HTML and today, we will continue to go to last tutorial: build WordPress theme from the HTML file.


Related posts:<ol><li><a href='http://aext.net/2009/12/wordpress-theme-from-scratch-%e2%80%93-day-2-psd-to-html/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 2: PSD to HTML'>WordPress Theme from Scratch – Day 2: PSD to HTML</a></li>
<li><a href='http://aext.net/2009/12/wordpress-theme-from-scratch-day-1-psd/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch &#8211; Day 1: PSD'>WordPress Theme from Scratch &#8211; Day 1: PSD</a></li>
<li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[This tutorial is in the series of “WordPress Theme from Scratch” that helps you build a WordPress theme by yourself from nothing. Previous tutorial in this series helped we convert a mockup in PSD to HTML and today, we will continue to go to last tutorial: build WordPress theme from the HTML file.

<span id="more-2571"></span>

The most difference between WordPress and other blog platforms in theme development is WordPress theme more easier than others for development. In basic, the elements of wordpress theme likes blocks and building WordPress theme likes we build these blocks to make them to fit together.

In WordPress template, some file we will use to display it in all page on our website such as: header, footer, sidebar ... and other file we have to customize it to fit our requirements under specific conditions. If you are going to build a WordPress theme, I recommend to take a look at "<a href="http://codex.wordpress.org/Using_Themes" rel="nofollow" >Using_Themes section in  WordPress Codex</a>" to understand how a theme built. 

<div class="demo-download">
<ul>
<li><a href="http://www.box.net/shared/9otld8r2t0" rel="nofollow" class="downloadit" >Download</a></li>
<li><a href="http://aext.net/theme/"class="demoit" >Demo</a></li>
</ul>
</div>

<h3>Prepare files for theme</h3>
<hr />

In this tutorial, I will help you build your first WordPress theme that <em>works</em>. That means I'm gonna build some important files that WordPress requires to run without errors. My FrozenFlirt WordPress theme should contains these files:

<pre>
--<strong>FrozenFlirt</strong>
-----header.php
-----index.php (Homepage display)
-----single.php (Post display)
-----archive.php (Archive display for categories, tags, date, authors...)
-----comments.php (Comment temple include form, post comments)
-----sidebar.php
-----functions.php (All of your template functions will go here)
-----footer.php
-----style.css
-----<strong>image</strong>
-----<strong>js</strong>
</pre>

<strong>Note:</strong> These files need for your template works with basic requirements such as: post, categories, tags, authors, search ... viewing. If you want more, build as same as we are doing here with 404 display, links template ...

Before start, copy all images in this HTML layout to <strong>images</strong> directory and all css files to the root theme folder. Furthermore, this theme is using one javascript file call <em>script.js</em>, so copy this file to folder <strong>js</strong>.

Let's begin!

<h3>Split HTML layout</h3>
<hr />
We will use header, sidebar and footer to display in all pages, so we need to split our HTML file into 3 main parts: header.php, sidebar.php and footer.php.

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/WordPress-theme-splitting-template-files-2-e1262852552626.png" alt="" title="WordPress theme splitting template files 2" width="500" height="609" class="aligncenter size-full wp-image-2583" />
</div>

Refer to the HTML file in previous tutorial: <a href="http://aext.net/2009/12/wordpress-theme-from-scratch-%E2%80%93-day-2-psd-to-html/">WordPress Theme from Scratch – Day 2: PSD to HTML</a> and after splitting, we have these files:

header.php

<pre class="html">
<em><span style="color:#236e25;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span></em>
<span style="color:#881280;">&lt;html </span><span style="color:#994500;">xmlns</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color:#881280;">&gt;</span>
<span style="color:#881280;">&lt;head&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;meta </span><span style="color:#994500;">http-equiv</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Content-Type&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">content</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/html; charset=UTF-8&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;title&gt;</span>FrozenFlirt Wordpress Theme From Scratch<span style="color:#881280;">&lt;/title&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;link </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;reset.css&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;stylesheet&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/css&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;link </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;style.css&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;stylesheet&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/css&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;link </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagenavi-css.css&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;stylesheet&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/css&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;script </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;">&gt;&lt;/script&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;script </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;script.js&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;">&gt;&lt;/script&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;script </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;">&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(document).<span style="color:#003369;">ready</span>(<span style="color:#881350;">function</span>() {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> id = <span style="color:#760f15;">'35591378@N03'</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">flickr</span>(id);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/script&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;

<span style="color:#881280;">&lt;/head&gt;</span>

<span style="color:#881280;">&lt;body&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;main-wrapper&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;container&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;header&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;ul </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;topmenu&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Home Page&quot;</span><span style="color:#881280;">&gt;&lt;span&gt;</span>Home<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Tutorial Category&quot;</span><span style="color:#881280;">&gt;&lt;span&gt;</span>Tutorial<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Freebie Category&quot;</span><span style="color:#881280;">&gt;&lt;span&gt;</span>Freebie<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Inspiration Category&quot;</span><span style="color:#881280;">&gt;&lt;span&gt;</span>Inspiration<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Resources Category&quot;</span><span style="color:#881280;">&gt;&lt;span&gt;</span>Resources<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/ul&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;topsearch&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;form </span><span style="color:#994500;">action</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://aext.net/&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;searchform&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">method</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;get&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;fieldset&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;input </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">onblur</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;if (this.value == '') {this.value = 'Type Keywords And Hit Enter...';}&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">onfocus</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;if(this.value == 'Type Keywords And Hit Enter...') {this.value = '';}&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Type Keywords And Hit Enter...&quot;</span><span style="color:#881280;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;searchfield&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;searchbox&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;s&quot;</span><span style="color:#881280;">/&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/fieldset&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/form&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;logo&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;FrozenFlirt Homepage&quot;</span><span style="color:#881280;">&gt;&lt;h1&gt;</span>FrozenFlirt Theme<span style="color:#881280;">&lt;/h1&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h3&gt;</span>&quot;Wordpress Theme From Scratch&quot;<span style="color:#881280;">&lt;/h3&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
</pre>

sidebar.php

<pre class="html">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;sidebar&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;widget&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;adblocks&quot;</span><span style="color:#881280;">&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;images/ads/vivatheme.png&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Viva Theme&quot;</span><span style="color:#881280;"> /&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;images/ads/pixelcrayons.jpg&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Pixel Crayons&quot;</span><span style="color:#881280;"> /&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;images/ads/wpbest.gif&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;WPBEST&quot;</span><span style="color:#881280;"> /&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;images/ads/buysellstockdesign.gif&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Buy Sell Stock Design&quot;</span><span style="color:#881280;"> /&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;widget&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;popular-posts&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h3&gt;</span>Popular Posts<span style="color:#881280;">&lt;/h3&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;ul&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;&lt;a </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;blablabla&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;&lt;span </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;wpp-post-title&quot;</span><span style="color:#881280;">&gt;</span>5 New Useful jQuery Plugins For Your Next Projects<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span> <span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;&lt;a </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;blablabla&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;&lt;span </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;wpp-post-title&quot;</span><span style="color:#881280;">&gt;</span>35 Fresh and Cool Web Design Interfaces for Inspiration<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span> <span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;&lt;a </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;blablabla&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;&lt;span </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;wpp-post-title&quot;</span><span style="color:#881280;">&gt;</span>Bubble Effect with CSS<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span> <span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;&lt;a </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;blablabla&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;&lt;span </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;wpp-post-title&quot;</span><span style="color:#881280;">&gt;</span>CSS Absolute Positioning: Create A Fancy Link Block<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span> <span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;&lt;a </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;blablabla&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;&lt;span </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;wpp-post-title&quot;</span><span style="color:#881280;">&gt;</span>Incredible Drop Down Menu Solution With CSS Only<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span> <span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/ul&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
</pre>

footer.php

<pre class="html">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;flickr-stream&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h3&gt;</span>Flickr Stream<span style="color:#881280;">&lt;/h3&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;hr /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;flickr&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;noscript&gt;</span>Your message for people w/o javascript enabled goes here.<span style="color:#881280;">&lt;/noscript&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;twitter-update&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h3&gt;</span>Twitter Update<span style="color:#881280;">&lt;/h3&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;hr /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;twitter&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;ul </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">'twitter_update_list'</span><span style="color:#881280;">&gt;&lt;/ul&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://twitter.com/prlamnguyen&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Follow me on twitter&quot;</span><span style="color:#881280;">&gt;&lt;span </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;followme&quot;</span><span style="color:#881280;">&gt;</span>Follow Me!<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;footer-wrapper&quot;</span><span style="color:#881280;">&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;container&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;copyright&quot;</span><span style="color:#881280;">&gt;&amp;copy;</span>2009 FrozenFlirt. All Rights Reserved<span style="color:#881280;">&lt;/p&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;designedby&quot;</span><span style="color:#881280;">&gt;</span>Wordpress Theme Design by <span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://aext.net&quot;</span><span style="color:#881280;">&gt;&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;images/aext.png&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Theme by AEXT.NET&quot;</span><span style="color:#881280;"> /&gt;&lt;/a&gt;&lt;/p&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;script </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://twitter.com/javascripts/blogger.js&quot;</span><span style="color:#881280;">&gt;&lt;/script&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;script </span><span style="color:#994500;">text</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://twitter.com/statuses/user_timeline/prlamnguyen.json?callback=twitterCallback2&amp;count=2&quot;</span><span style="color:#881280;">&gt;&lt;/script&gt;</span>
&nbsp;
<span style="color:#881280;">&lt;/body&gt;</span>
<span style="color:#881280;">&lt;/html&gt;</span>
</pre>

The remain part we will use for replace with the content.

<h3>header.php</h3>
<hr />
The header file need to declare the blog title, description (if you are using SEO plugin, I don't think this part is important), blog feed, pingback... And off course, you need to put your stylesheet here.

Put these code to your header for:

HTML type

<pre class="html">
<span style="color:#881280;">&lt;meta </span><span style="color:#994500;">http-equiv</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Content-Type&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">content</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'html_type'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">; charset=</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'charset'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
</pre>

Blog title

<pre class="html">
<span style="color:#881280;">&lt;title&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">wp_title</span>(<span style="color:#eb7300;">'&amp;laquo;'</span>, <span style="color:#881350;">true</span>, <span style="color:#eb7300;">'right'</span>); <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'name'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/title&gt;</span>
</pre>

Blog description

<pre class="html">
<span style="color:#881280;">&lt;meta </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;description&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">content</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'description'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
</pre>

Feed and pingback

<pre class="html">
<span style="color:#881280;">&lt;link </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;alternate&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;application/rss+xml&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'name'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;"> RSS Feed&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'rss2_url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
<span style="color:#881280;">&lt;link </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;alternate&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;application/atom+xml&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'name'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;"> Atom Feed&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'atom_url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
<span style="color:#881280;">&lt;link </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pingback&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'pingback_url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
</pre>

Because you will upload this theme to the themes folder, you need to gather the blog directory to import exactly the url to your css, javascript ... files. Using this code, you will get the url to your template folder:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_url'</span>); <span style="color:#dd0000;">?&gt;</span>
</pre>

Link to your stylesheet using code above:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span>

&nbsp;&nbsp;<span style="color:#881350;">print</span> <span style="color:#eb7300;">'&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;'</span>;
&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#881350;">print</span> <span style="color:#eb7300;">'@import &quot;'</span>.<span style="color:#003369;">get_bloginfo</span>(<span style="color:#eb7300;">'template_url'</span>).<span style="color:#eb7300;">'/reset.css&quot;;'</span>;
&nbsp;&nbsp;<span style="color:#881350;">print</span> <span style="color:#eb7300;">'@import &quot;'</span>.<span style="color:#003369;">get_bloginfo</span>(<span style="color:#eb7300;">'template_url'</span>).<span style="color:#eb7300;">'/style.css&quot;;'</span>; &nbsp;
&nbsp;&nbsp;<span style="color:#881350;">print</span> <span style="color:#eb7300;">'@import &quot;'</span>.<span style="color:#003369;">get_bloginfo</span>(<span style="color:#eb7300;">'template_url'</span>).<span style="color:#eb7300;">'/pagenavi-css.css&quot;;'</span>; 

&nbsp;&nbsp;<span style="color:#881350;">print</span> <span style="color:#eb7300;">'&lt;/style&gt;'</span>;
&nbsp;&nbsp;
<span style="color:#dd0000;">?&gt;</span>
</pre>

For more information about <em>bloginfo</em>, check this page <a href="http://codex.wordpress.org/Bloginfo" rel="nofollow" >Template Tags/bloginfo</a>.

DON'T FORGET to put these code before closing the head tag

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">wp_head</span>(); <span style="color:#dd0000;">?&gt;</span>
</pre>

This is one of the most essential theme hooks. You use this hook by having your function echo output to the browser, or by having it perform background tasks. This is very important because all of the plugins installed will use this hook to output their code such as css and javascript to template header.

In this theme, you can see that I made the rounded border style for the categories link on header. It will be easy to list all category links if we just make simple links by using this code:

<pre class="html">
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;ul&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span>Home<span style="color:#881280;">&lt;/a&gt;&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#003369;">wp_list_categories</span>(<span style="color:#eb7300;">'echo=0&amp;title_li='</span>); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/ul&gt;</span>
</pre>

However, this function just generate a list of category with links and we cannot put a span tag inside the link to make a rounded border style like what we do with the HTML template.

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/Wordpress-Theme-Rounded-Border-Link.png" alt="" title="Wordpress Theme Rounded Border Link" width="500" height="166" class="aligncenter size-full wp-image-2606" />
</div>

This is why we use this code instead;

<pre class="html">
<span style="color:#881280;">&lt;ul </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;topmenu&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Home Page&quot;</span><span style="color:#881280;">&gt;&lt;span&gt;</span>Home<span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$args</span>=<span style="color:#881350;">array</span>(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'orderby'</span> =&gt; <span style="color:#eb7300;">'name'</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'order'</span> =&gt; <span style="color:#eb7300;">'ASC'</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$categories</span>=<span style="color:#003369;">get_categories</span>(<span style="color:#825900;">$args</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">foreach</span>(<span style="color:#825900;">$categories</span> <span style="color:#881350;">as</span> <span style="color:#825900;">$category</span>) { 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">echo</span> <span style="color:#eb7300;">'&lt;li&gt;'</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">echo</span> <span style="color:#eb7300;">'&lt;a href=&quot;'</span> . <span style="color:#003369;">get_category_link</span>( <span style="color:#825900;">$category</span>-&gt;term_id ) . <span style="color:#eb7300;">'&quot; title=&quot;'</span> . <span style="color:#661aa9;">sprintf</span>( <span style="color:#003369;">__</span>( <span style="color:#eb7300;">&quot;View all posts in %s&quot;</span> ), &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$category</span>-&gt;name ) . <span style="color:#eb7300;">'&quot; '</span> . <span style="color:#eb7300;">'&gt;&lt;span&gt;'</span> . <span style="color:#825900;">$category</span>-&gt;name.<span style="color:#eb7300;">'&lt;/span&gt;&lt;/a&gt; &lt;/p&gt; '</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">echo</span> <span style="color:#eb7300;">'&lt;/li&gt;'</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} 
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>


<span style="color:#881280;">&lt;/ul&gt;</span>
</pre>
 
Now, with the css code I provided previous tutorial, we can build great rounded border link style.



<h3>sidebar.php</h3>
<hr />

Actually, the sidebar is very simple. Themes usually have at least 1 or 2 sidebars, in this case, we have one. Each section in the sidebar is known as a "widget" that you can add or remove, and move up or down. You can configure your sidebar by going to <strong>Appearance > Widgets</strong>. Because nothing is special here, we only need to make it ready for widgets. That means you can add/remove widget in your sidebar in admin panel. In this case, I will keep the ads section as HTML, other widgets will be updated through widgets configuration.

In your sidebar.php, add these code:

<pre class="html">
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;sidebar&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;widget&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;adblocks&quot;</span><span style="color:#881280;">&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_directory'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">/images/ads/vivatheme.png&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Viva Theme&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_directory'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">/images/ads/pixelcrayons.jpg&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Pixel Crayons&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_directory'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">/images/ads/wpbest.gif&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;WPBEST&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_directory'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">/images/ads/buysellstockdesign.gif&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Buy Sell Stock Design&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">if</span><span style="color:#003369;"> </span>( !<span style="color:#661aa9;">function_exists</span>(<span style="color:#eb7300;">'dynamic_sidebar'</span>) || !<span style="color:#003369;">dynamic_sidebar</span>() ) : <span style="color:#dd0000;">?&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endif</span>; <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
</pre>

The code above will keep the ads section stays in the sidebar even when you add widgets in admin panel or not. Other widgets will be added through admin panel and be right next below to ads block.

However, that's not enough. Because, in this case, we are setting up the sidebar widgets as div elements, we need to set up the sidebar format by using <em>register_sidebar()</em> in functions.php file. In functions.php file, add these code:

<pre class="php">
<em><span style="color:#236e25;">// register sidebars
</span></em><span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#661aa9;">function_exists</span>(<span style="color:#eb7300;">'register_sidebar'</span>)) {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">register_sidebar</span>(<span style="color:#881350;">array</span>(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'name'</span> =&gt; <span style="color:#eb7300;">'Default sidebar'</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'id'</span> =&gt; <span style="color:#eb7300;">'sidebar-1'</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'before_widget'</span> =&gt; <span style="color:#eb7300;">'&lt;div class=&quot;widget&quot; id=&quot;%1$s&quot;&gt;'</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'after_widget'</span> =&gt; <span style="color:#eb7300;">'&lt;/div&gt;'</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'before_title'</span> =&gt; <span style="color:#eb7300;">'&lt;h3&gt;'</span>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">'after_title'</span> =&gt; <span style="color:#eb7300;">'&lt;/h3&gt;'</span>
&nbsp;&nbsp;&nbsp;&nbsp;));
}
</pre>

This code used for register the default side that all widgets inside it will come inside div element with class name <em>widget</em> and their id by plugin widgets. The title of each widget will be wrap by an <em>h3</em> tag.

That's all you need for a sidebar with widget ready. Download this plugin <a href="http://wordpress.org/extend/plugins/wordpress-popular-posts/" rel="nofollow" >Wordpress Popular Posts</a>, install, active then drag the widget to the sidebar. Done!

<h3>footer.php file</h3>
<hr />
Honestly, there is nothing important here. Some blog design their beautiful footer with a lot of stuff, but in this case we only create two widgets for Flickr stream and Twitter update using javascript to make this tutorial simple. These widget display will depend on the user's Flirkr and Twitter account, so we will create these widget display base on the options that user will put their account in. Luckily I published an useful posts "<a href="http://aext.net/2009/10/wordpress-theme-design-with-options-adminstration/">Wordpress Theme Design with Options Adminstration</a>". Now, you have to check this post first because it's very complicated step that should not put here for a very long long long tutorial. It's not necessary, but at least put some code for this tutorial more complete.

In functions.php file, put these code for theme options:

<pre class="php">
<em><span style="color:#236e25;">// theme options
</span></em><span style="color:#825900;">$options</span> = <span style="color:#881350;">array</span><span style="color:#003369;"> </span>(

&nbsp;&nbsp;<span style="color:#881350;">array</span>( &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;name&quot;</span> =&gt; <span style="color:#eb7300;">&quot;&lt;strong&gt;Flickr ID&lt;/strong&gt;&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;desc&quot;</span> =&gt; <span style="color:#eb7300;">&quot;Enter your Flickr ID to display Flickr Stream widget&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;id&quot;</span> =&gt; <span style="color:#eb7300;">&quot;flickr_account&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;default&quot;</span> =&gt; <span style="color:#eb7300;">&quot;&quot;</span>),


&nbsp;&nbsp;<span style="color:#881350;">array</span>( &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;name&quot;</span> =&gt; <span style="color:#eb7300;">&quot;&lt;strong&gt;Twitter Account&lt;/strong&gt;&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;desc&quot;</span> =&gt; <span style="color:#eb7300;">&quot;Enter your Twitter username to display Twitter Update widget&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;id&quot;</span> =&gt; <span style="color:#eb7300;">&quot;twitter_account&quot;</span>,
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#eb7300;">&quot;default&quot;</span> =&gt; <span style="color:#eb7300;">&quot;prlamnguyen&quot;</span>),
&nbsp;&nbsp;&nbsp;
);
</pre>

These lines of code will control the form submission of the theme options:

<pre class="php">
<span style="color:#881350;">function</span> <span style="color:#003369;">frozenflirt_options</span>() {
&nbsp;&nbsp;<span style="color:#881350;">global</span> <span style="color:#825900;">$options</span>;

&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#eb7300;">'theme_save'</span>== <span style="color:#825900;">$_REQUEST</span>[<span style="color:#eb7300;">'action'</span>] ) {
&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">foreach</span><span style="color:#003369;"> </span>(<span style="color:#825900;">$options</span> <span style="color:#881350;">as</span> <span style="color:#825900;">$value</span>) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span>( !<span style="color:#003369;">isset</span>( <span style="color:#825900;">$_REQUEST</span>[ <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>] ] ) ) { &nbsp;} <span style="color:#881350;">else</span> { <span style="color:#003369;">update_option</span>( <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>], <span style="color:#661aa9;">stripslashes</span>(<span style="color:#825900;">$_REQUEST</span>[ <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>]])); } }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span>(<span style="color:#661aa9;">stristr</span>(<span style="color:#825900;">$_SERVER</span>[<span style="color:#eb7300;">'REQUEST_URI'</span>],<span style="color:#eb7300;">'&amp;saved=true'</span>)) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$location</span> = <span style="color:#825900;">$_SERVER</span>[<span style="color:#eb7300;">'REQUEST_URI'</span>];
&nbsp;&nbsp;&nbsp;&nbsp;} <span style="color:#881350;">else</span> {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$location</span> = <span style="color:#825900;">$_SERVER</span>[<span style="color:#eb7300;">'REQUEST_URI'</span>] . <span style="color:#eb7300;">&quot;&amp;saved=true&quot;</span>;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#661aa9;">header</span>(<span style="color:#eb7300;">&quot;Location: </span><span style="color:#c94b16;">$location</span><span style="color:#eb7300;">&quot;</span>);
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">die</span>;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;} <span style="color:#881350;">else</span> <span style="color:#881350;">if</span>(<span style="color:#eb7300;">'theme_reset'</span> == <span style="color:#825900;">$_REQUEST</span>[<span style="color:#eb7300;">'action'</span>] ) {
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">foreach</span><span style="color:#003369;"> </span>(<span style="color:#825900;">$options</span> <span style="color:#881350;">as</span> <span style="color:#825900;">$value</span>) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">delete_option</span>( <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>] );
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$location</span> = <span style="color:#825900;">$_SERVER</span>[<span style="color:#eb7300;">'REQUEST_URI'</span>] . <span style="color:#eb7300;">&quot;&amp;reset=true&quot;</span>;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#661aa9;">header</span>(<span style="color:#eb7300;">&quot;Location: </span><span style="color:#c94b16;">$location</span><span style="color:#eb7300;">&quot;</span>);
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">die</span>;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;}
&nbsp;&nbsp;
&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#003369;">add_theme_page</span>(<span style="color:#eb7300;">'FrozenFlirt Theme Setting'</span>, <span style="color:#eb7300;">'FrozenFlirt Theme Setting'</span>, <span style="color:#0000ff;">10</span>, <span style="color:#eb7300;">'frozenflirt-settings'</span>, <span style="color:#eb7300;">'frozenflirt_admin'</span>);
}
</pre>


And these code for the UI in admin panel:

<pre class="php">
<span style="color:#dd0000;">&lt;?php</span> 
<span style="color:#881350;">function</span> <span style="color:#003369;">frozenflirt_admin</span>() {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">global</span> <span style="color:#825900;">$options</span>;
<span style="color:#dd0000;">?&gt;</span>
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;wrap&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;alignleft&quot;</span><span style="color:#881280;">&gt;</span>Theme Setting<span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;br </span><span style="color:#994500;">clear</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;all&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;
&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> 
&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">//Check if settings saved!
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#825900;">$_REQUEST</span>[<span style="color:#eb7300;">'saved'</span>] ) {
&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;updated fade&quot;</span><span style="color:#881280;">&gt;&lt;p&gt;&lt;strong&gt;</span>Setting Saved<span style="color:#881280;">&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;</span>
&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> } <span style="color:#dd0000;">?&gt;</span>

<span style="color:#881280;">&lt;form </span><span style="color:#994500;">method</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;post&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;myForm&quot;</span><span style="color:#881280;">&gt;</span>
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;poststuff&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;metabox-holder&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;
&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;stuffbox&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;h3&gt;</span>Footer Setting<span style="color:#881280;">&lt;/h3&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;inside&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;table </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;form-table&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">style</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;width: auto&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">foreach</span><span style="color:#003369;"> </span>(<span style="color:#825900;">$options</span> <span style="color:#881350;">as</span> <span style="color:#825900;">$value</span>) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">switch</span><span style="color:#003369;"> </span>( <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>] ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">case</span> <span style="color:#eb7300;">&quot;flickr_account&quot;</span>: <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;tr&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;th </span><span style="color:#994500;">scope</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;row&quot;</span><span style="color:#881280;">&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'name'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;br /&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'desc'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/th&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;td&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;input </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_option</span>(<span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>])?<span style="color:#661aa9;">printf</span>(<span style="color:#003369;">get_option</span>(<span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>])): <span style="color:#661aa9;">printf</span>(<span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'default'</span>]) <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/td&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/tr&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">break</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">case</span> <span style="color:#eb7300;">&quot;twitter_account&quot;</span>: <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;tr&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;th </span><span style="color:#994500;">scope</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;row&quot;</span><span style="color:#881280;">&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'name'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;br /&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'desc'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/th&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;td&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;input </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>]; <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text&quot;</span><span style="color:#881280;"> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_option</span>(<span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>])?<span style="color:#661aa9;">printf</span>(<span style="color:#003369;">get_option</span>(<span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'id'</span>])): <span style="color:#661aa9;">printf</span>(<span style="color:#825900;">$value</span>[<span style="color:#eb7300;">'default'</span>]) <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/td&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/tr&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">break</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/table&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;<span style="color:#881280;">&lt;/div&gt;</span> &nbsp;

<span style="color:#881280;">&lt;/div&gt;</span>
<span style="color:#881280;">&lt;input </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;theme_save&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;submit&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;button-primary&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Save changes&quot;</span><span style="color:#881280;"> /&gt;</span>
<span style="color:#881280;">&lt;input </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;hidden&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;action&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;theme_save&quot;</span><span style="color:#881280;"> /&gt;</span>
<span style="color:#881280;">&lt;/form&gt;</span>

<span style="color:#881280;">&lt;form </span><span style="color:#994500;">method</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;post&quot;</span><span style="color:#881280;">&gt;</span>
<span style="color:#881280;">&lt;input </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;theme_reset&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;submit&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;button-primary&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Reset&quot;</span><span style="color:#881280;"> /&gt;</span>
<span style="color:#881280;">&lt;input </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;hidden&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">name</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;action&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">value</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;theme_reset&quot;</span><span style="color:#881280;"> /&gt;</span>
<span style="color:#881280;">&lt;/form&gt;</span>


<span style="color:#881280;">&lt;/div&gt;</span>
<span style="color:#dd0000;">&lt;?php</span>
}
<span style="color:#dd0000;">?&gt;</span>
</pre>

Your theme options adminstration will look like:

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/Wordpress-Theme-Options.png" alt="" title="Wordpress Theme Options" width="500" height="270" class="aligncenter size-full wp-image-2608" />
</div>

We are good now with the theme options. Let's get these value to display in the theme. In your footer.php, insert these code to your Twitter widgets to get twitter account name from theme options:

<pre class="html">
<span style="color:#881280;">&lt;script </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://twitter.com/javascripts/blogger.js&quot;</span><span style="color:#881280;">&gt;&lt;/script&gt;</span>
<span style="color:#881280;">&lt;script </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;http://twitter.com/statuses/user_timeline/</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">if</span>(!<span style="color:#003369;">get_option</span>(<span style="color:#eb7300;">'twitter_account'</span>)) { <span style="color:#881350;">echo</span> <span style="color:#eb7300;">'prlamnguyen'</span>; } <span style="color:#881350;">else</span> { <span style="color:#661aa9;">printf</span>(<span style="color:#003369;">get_option</span>(<span style="color:#eb7300;">'twitter_account'</span>)); } <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">.json?callback=twitterCallback2&amp;count=2&quot;</span><span style="color:#881280;">&gt;&lt;/script&gt;</span>
</pre>

In this code above, if the option value of twitter_account doesn't exist, this widget will display twitter update from my twitter account by default. <img src='http://aext.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> 

With Flickr Stream widget, go back to header.php file to edit because I put the jQuery code to get stream from specific account on header.php file. I'm so sorry! If you want, move this code block to the footer.php file. That's fine!

<pre class="html">
<span style="color:#881280;">&lt;script </span><span style="color:#994500;">type</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;text/javascript&quot;</span><span style="color:#881280;">&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(document).<span style="color:#003369;">ready</span>(<span style="color:#881350;">function</span>() {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">var</span> id = <span style="color:#760f15;">'</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#661aa9;">printf</span>(<span style="color:#003369;">get_option</span>(<span style="color:#eb7300;">'flickr_account'</span>)); <span style="color:#dd0000;">?&gt;</span><span style="color:#760f15;">'</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">flickr</span>(id);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});

<span style="color:#881280;">&lt;/script&gt;</span>
</pre>

Alright, now you have done for the three files that will used in all pages. Now, we continue to go forward to other pages that display in homepage, post pages, categories pages...

<h3>index.php</h3>
<hr />
This file will used for display in the main page of your blog. It usually displays a number of recent articles. The number of posts will be display was set up in your <strong>WordPress Admin > Setting > Reading</strong> as below:

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/WordPress-theme-setting-up-number-of-posts-willl-be-displayed-in-homepage.png" alt="" title="WordPress theme setting up number of posts willl be displayed in homepage" width="500" height="294" class="aligncenter size-full wp-image-2589" />
</div>

By default, you don't need to query posts in homepage, the only code for the loop of display post in homepage is:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span>


<em><span style="color:#236e25;">//The Loop
</span></em><span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#003369;">have_posts</span>() ) : 

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">while</span><span style="color:#003369;"> </span>( <span style="color:#003369;">have_posts</span>() ) : <span style="color:#003369;">the_post</span>();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">//Posts in the loop
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">endwhile</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#881350;">else</span>:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">//No post in homepage ?????
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#881350;">endif</span>;


<span style="color:#dd0000;">?&gt;</span>
</pre>

However, sometime we need to display post in homepage with conditions. An example with Noupe.com, they are using the Community News which all of news were submit will go to News category, but they don't want to display a lot of community news in homepage. The best way to do is override and replace the main query in homepage. In the case I have just mentioned(At this time, Noupe has disabled Community submission !!!), the replaced query will be:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span>

<em><span style="color:#236e25;">//Begin replace the main query
</span></em><span style="color:#003369;">query_posts</span>(<span style="color:#eb7300;">'cat=-155'</span>); <em><span style="color:#236e25;">//155 is the id of Community News category
</span></em>
<em><span style="color:#236e25;">//The Loop
</span></em><span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#003369;">have_posts</span>() ) : 

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">while</span><span style="color:#003369;"> </span>( <span style="color:#003369;">have_posts</span>() ) : <span style="color:#003369;">the_post</span>();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">//Posts in the loop
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">endwhile</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#881350;">else</span>:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">//No post in homepage ?????
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#881350;">endif</span>;

<em><span style="color:#236e25;">//Reset the query
</span></em><span style="color:#003369;">wp_reset_query</span>();


<span style="color:#dd0000;">?&gt;</span>
</pre>

With the query_posts, you can change the order, number of posts.... I would like to forward a link to <a href="http://codex.wordpress.org/Template_Tags/query_posts" rel="nofollow" >Template Tags/query posts</a> to check more information and usages.

Way back to the tutorial, you already knew how to use the loop in display posts, now we begin to work with our index.php. But at first, you have to clean this index.php because we have 4 blocks of post in HTML template. Keep only one post excerpt, remove all of others.

Before starting write code for display post excerpts, we need to look back to the split files. You remember that we split our HTML file into 3 files: <em>header.php</em>, <em>sidebar.php</em> and <em>footer.php</em>. Now, we need to include them again. In index.php file, put your header, sidebar and footer:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span>
&nbsp;
<em><span style="color:#236e25;">/**
&nbsp;* @package WordPress
&nbsp;* @subpackage FrozenFlirt_Theme
&nbsp;*/</span></em>
<span style="color:#dd0000;">?&gt;</span>

<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_header</span>(); <span style="color:#dd0000;">?&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;main-content&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;..........
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_sidebar</span>(); <span style="color:#dd0000;">?&gt;</span>

<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_footer</span>(); <span style="color:#dd0000;">?&gt;</span>
</pre>

In main content elements, we write a loop of post to display:

<pre class="html">
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;main-content&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;container&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#881350;">while</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#003369;">the_post</span>(); 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;post exerpt clearfix&quot;</span><span style="color:#881280;">&gt;</span> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;</span> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;ahh ahh ahh&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;images/post-image-1.png&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">width</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;200&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">height</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;200&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;thumbnail&quot;</span><span style="color:#881280;"> /&gt;</span> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2&gt;&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;nofollow&quot;</span><span style="color:#881280;">&gt;</span>Fronze Flirt Theme<span style="color:#881280;">&lt;/a&gt;&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;small&gt;</span>Written by <span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Lam Nguyen&quot;</span><span style="color:#881280;">&gt;</span>Lam Nguyen<span style="color:#881280;">&lt;/a&gt;</span> on <span style="color:#881280;">&lt;strong&gt;</span>Dec 11th<span style="color:#881280;">&lt;/strong&gt;</span> in <span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Tutorial Category&quot;</span><span style="color:#881280;">&gt;</span>Tutorials<span style="color:#881280;">&lt;/a&gt;&lt;/small&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;summary&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p&gt;</span>Lorem ipsum dolor sit amet, this is bold text consectetur adipiscing elit. This font is in italic cras lacinia pellentesque elit nec sodales. Etiam vehicula egestas interdum. Nulla facilisi. In at lectus odio, quis iaculis dui. <span style="color:#881280;">&lt;/p&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p&gt;&lt;a </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;nofollow&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Read more this post&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;#&quot;</span><span style="color:#881280;">&gt;</span>Continue Reading <span style="color:#881280;">&amp;raquo;&lt;/a&gt;&lt;/p&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endwhile</span>; <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">if</span>(<span style="color:#661aa9;">function_exists</span>(<span style="color:#eb7300;">'wp_pagenavi'</span>)) : <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">wp_pagenavi</span>() <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">else</span> : <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;navigation&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagenavi&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;alignleft&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">next_posts_link</span>(<span style="color:#003369;">__</span>(<span style="color:#eb7300;">'&amp;laquo; Older Entries'</span>,<span style="color:#eb7300;">'arclite'</span>)) <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;alignright&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">previous_posts_link</span>(<span style="color:#003369;">__</span>(<span style="color:#eb7300;">'Newer Entries &amp;raquo;'</span>,<span style="color:#eb7300;">'arclite'</span>)) <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;clear&quot;</span><span style="color:#881280;">&gt;&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endif</span>; <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">else</span>: <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#661aa9;">printf</span>(<span style="color:#eb7300;">&quot;Sorry, no posts matched your criteria.&quot;</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/p&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endif</span>; <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
<span style="color:#881280;">&lt;/div&gt;</span>
</pre>

This loop will display the number of post with the same title, thumbnail, description... because we haven't change the code to display correct post title, post description... These code below is used for replace the HTML in the loop:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#881350;">while</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#003369;">the_post</span>(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#dd0000;">?&gt;</span>
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;post excerpt clearfix&quot;</span><span style="color:#881280;">&gt;</span> 
&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_permalink</span>() <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#003369;">has_post_thumbnail</span>() ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">the_post_thumbnail</span>(<span style="color:#881350;">array</span>(<span style="color:#0000ff;">200</span>,<span style="color:#0000ff;">200</span>), <span style="color:#881350;">array</span>(<span style="color:#eb7300;">'class'</span> =&gt; <span style="color:#eb7300;">'thumbnail'</span>));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span style="color:#881350;">else</span> {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// Who doesn't want a thumbnail??
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;h2&gt;&lt;a </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;nofollow&quot;</span><span style="color:#881280;"> &nbsp;</span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_permalink</span>() <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_title</span>(); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#881280;">&lt;small&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Written by <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_author_posts_link</span>(); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;on <span style="color:#881280;">&lt;strong&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_time</span>(<span style="color:#eb7300;">'F jS'</span>) <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/strong&gt;</span> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_category</span>(<span style="color:#eb7300;">', '</span>); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;/small&gt;</span>
&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;summary&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_content</span>( <span style="color:#eb7300;">'Continue Reading &amp;raquo;'</span> ); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;
<span style="color:#881280;">&lt;/div&gt;</span>
<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endwhile</span>; <span style="color:#dd0000;">?&gt;</span>
</pre>

Wow, we're going to the most interesting feature of WordPress 2.9: <strong>Thumbnail Generation for Post</strong>. You remember, in the past, how we made thumbnail for a post? It was really a nightmare with a lot of code and stuff. Today, everything has changed. With few lines of codes, you can insert thumbnail for posts easily.

In functions.php file, insert these code to active the new feature:

<pre class="php">
<span style="color:#003369;">add_theme_support</span>( <span style="color:#eb7300;">'post-thumbnails'</span>, <span style="color:#881350;">array</span>( <span style="color:#eb7300;">'post'</span> ) );
</pre>

You can make this feature active for posts, pages... but for posts only in this case. Display the thumbnail within the loop:

<pre class="html">
<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_permalink</span>() <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#003369;">has_post_thumbnail</span>() ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">the_post_thumbnail</span>(<span style="color:#881350;">array</span>(<span style="color:#0000ff;">200</span>,<span style="color:#0000ff;">200</span>), <span style="color:#881350;">array</span>(<span style="color:#eb7300;">'class'</span> =&gt; <span style="color:#eb7300;">'thumbnail'</span>));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span style="color:#881350;">else</span> {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// Who doesn't want a thumbnail??<br />
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span><br />
<span style="color:#881280;">&lt;/a&gt;</span>
</pre>

This code will display the thumbnail with dimension: 200x200 pixels and the img tag is with class name thumbnail. The thumbnail will be added when writing post:

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/WordPress-theme-using-thumbnail-generation-feature-e1262930429762.png" alt="" title="WordPress theme using thumbnail generation feature" width="500" height="369" class="aligncenter size-full wp-image-2594" />
</div>

I recommend this post for new feature Post Thumbnail references: <a href="http://www.kremalicious.com/2009/12/wordpress-post-thumbnails/" rel="nofollow" >Using The New Post Thumbnail Feature In WordPress 2.9</a>.

<h3>archive.php</h3>
<hr />
This file will used for display category archive, tag archive... The easiest way is copy all code of index.php page and past it to archive.php because tag or category archive usually display in the same way as index page. In WordPress, when develop theme, the posts query was already made by WordPress, so that's why we need just copy and paste content of index.php to the archive.php file. As I said above, if you need to display something different such as: posts order, number of posts will be displayed... just use the <em>query_posts()</em> function to override and replace the main query for the page.

However, in archive.php file, you need to notify users which page they are on. Insert these code on the top, before display the loop of posts:

<pre class="html">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#825900;">$post</span> = <span style="color:#825900;">$posts</span>[<span style="color:#0000ff;">0</span>]; <em><span style="color:#236e25;">// Hack. Set $post so that the_date() works. </span></em><span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is a category archive */</span></em> <span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#003369;">is_category</span>()) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Archive for the <span style="color:#881280;">&amp;#8216;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">single_cat_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&amp;#8217;</span> Category<span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is a tag archive */</span></em> } <span style="color:#881350;">elseif</span>( <span style="color:#003369;">is_tag</span>() ) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Posts Tagged <span style="color:#881280;">&amp;#8216;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">single_tag_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&amp;#8217;&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is a daily archive */</span></em> } <span style="color:#881350;">elseif</span><span style="color:#003369;"> </span>(<span style="color:#003369;">is_day</span>()) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Archive for <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_time</span>(<span style="color:#eb7300;">'F jS, Y'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is a monthly archive */</span></em> } <span style="color:#881350;">elseif</span><span style="color:#003369;"> </span>(<span style="color:#003369;">is_month</span>()) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Archive for <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_time</span>(<span style="color:#eb7300;">'F, Y'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is a yearly archive */</span></em> } <span style="color:#881350;">elseif</span><span style="color:#003369;"> </span>(<span style="color:#003369;">is_year</span>()) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Archive for <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_time</span>(<span style="color:#eb7300;">'Y'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is an author archive */</span></em> } <span style="color:#881350;">elseif</span><span style="color:#003369;"> </span>(<span style="color:#003369;">is_author</span>()) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Author Archive<span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <em><span style="color:#236e25;">/* If this is a paged archive */</span></em> } <span style="color:#881350;">elseif</span><span style="color:#003369;"> </span>(<span style="color:#003369;">isset</span>(<span style="color:#825900;">$_GET</span>[<span style="color:#eb7300;">'paged'</span>]) &amp;&amp; !<span style="color:#003369;">empty</span>(<span style="color:#825900;">$_GET</span>[<span style="color:#eb7300;">'paged'</span>])) { <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2 </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;pagetitle&quot;</span><span style="color:#881280;">&gt;</span>Blog Archives<span style="color:#881280;">&lt;/h2&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> } <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">while</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#003369;">the_post</span>(); 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
</pre>

The result:

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/Wordpress-Theme-Archive-Page-Display.png" alt="" title="Wordpress Theme Archive Page Display" width="500" height="271" class="aligncenter size-full wp-image-2596" />
</div>

<h3>single.php</h3>
<hr />
This file is used for display your WordPress posts. In this file, I will tell you a small trick. In HTML template, you see the post display as below:

<pre class="html">
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;summary&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p&gt;</span>Post Excerpt<span style="color:#881280;">&lt;/p&gt;</span><br />
<br />
<span style="color:#881280;">&lt;/div&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;post-content&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;Post Main Content<br />
<br />
<span style="color:#881280;">&lt;/div&gt;</span>
</pre>

If you put <em>the_excerpt()</em> and <em>the_content()</em> together to display as above. That will not work because the post excerpt will be duplicated. Even when put the excerpt to the Excerpt field which located below the post editor. This is good if you want to display links or images in your excerpt, but it doesn't work here.

Alright, here is the trick. We will hook into <em>the_content</em>. In functions.php file, add these code:

<pre class="html">
<span style="color:#003369;">add_filter</span>(<span style="color:#eb7300;">'the_content'</span>, <span style="color:#eb7300;">'format_content'</span>);


<span style="color:#881350;">function</span> <span style="color:#003369;">format_content</span>(<span style="color:#825900;">$content</span>) {

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#661aa9;">preg_match</span>(<span style="color:#eb7300;">'/&lt;span id=&quot;(.*?)?&quot;&gt;&lt;\/span&gt;/'</span>, <span style="color:#825900;">$content</span>, <span style="color:#825900;">$matches</span>) ) {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$content</span> = <span style="color:#661aa9;">explode</span>(<span style="color:#825900;">$matches</span>[<span style="color:#0000ff;">0</span>], <span style="color:#825900;">$content</span>, <span style="color:#0000ff;">2</span>);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#825900;">$content</span> = <span style="color:#eb7300;">'&lt;div class=&quot;summary&quot;&gt;'</span> . <span style="color:#825900;">$content</span>[<span style="color:#0000ff;">0</span>] . <span style="color:#eb7300;">'&lt;/div&gt;'</span> . <span style="color:#825900;">$matches</span>[<span style="color:#0000ff;">0</span>] . <span style="color:#eb7300;">'&lt;div class=&quot;post-content&quot;&gt;'</span> . <span style="color:#825900;">$content</span>[<span style="color:#0000ff;">1</span>] . <span style="color:#eb7300;">'&lt;/div&gt;'</span>;
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">return</span> <span style="color:#825900;">$content</span>;

}
</pre>

We will split the content into 2 parts then wrap each part by specific div tag with class name "summary" and "post-content". Is that cool?

And this is the complete code of single.php file:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span>
&nbsp;
<em><span style="color:#236e25;">/**
&nbsp;* @package WordPress
&nbsp;* @subpackage FrozenFlirt_Theme
&nbsp;*/</span></em>
<span style="color:#dd0000;">?&gt;</span>

<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_header</span>(); <span style="color:#dd0000;">?&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">id</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;main-content&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;container&quot;</span><span style="color:#881280;">&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#881350;">while</span><span style="color:#003369;"> </span>(<span style="color:#003369;">have_posts</span>()) : <span style="color:#003369;">the_post</span>(); 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;div </span><span style="color:#994500;">class</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;post clearfix&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_permalink</span>() <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>( <span style="color:#003369;">has_post_thumbnail</span>() ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#003369;">the_post_thumbnail</span>(<span style="color:#881350;">array</span>(<span style="color:#0000ff;">200</span>,<span style="color:#0000ff;">200</span>), <span style="color:#881350;">array</span>(<span style="color:#eb7300;">'class'</span> =&gt; <span style="color:#eb7300;">'thumbnail'</span>));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span style="color:#881350;">else</span> {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">// Who doesn't want a thumbnail??
</span></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;h2&gt;&lt;a </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;nofollow&quot;</span><span style="color:#881280;"> &nbsp;</span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_permalink</span>() <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/a&gt;&lt;/h2&gt;</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;small&gt;</span>Written by <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_author_posts_link</span>(); <span style="color:#dd0000;">?&gt;</span> on <span style="color:#881280;">&lt;strong&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_time</span>(<span style="color:#eb7300;">'F jS'</span>) <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/strong&gt;</span> in <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_category</span>(<span style="color:#eb7300;">', '</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/small&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_content</span>(); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">comments_template</span>(); <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endwhile</span>; <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">else</span>: <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;p&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">_e</span>(<span style="color:#eb7300;">&quot;Sorry, no posts matched your criteria.&quot;</span>,<span style="color:#eb7300;">&quot;arclite&quot;</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/p&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endif</span>; <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/div&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_sidebar</span>(); <span style="color:#dd0000;">?&gt;</span>

<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">get_footer</span>(); <span style="color:#dd0000;">?&gt;</span>
</pre>

You have done with the single.php file, but don't forget to put <span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">comments_template</span>(); <span style="color:#dd0000;">?&gt;</span> before ending the loop.

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/Wordpress-Theme-split-post-content-into-2-parts-e1262938881543.png" alt="" title="Wordpress Theme split post content into 2 parts" width="500" height="253" class="aligncenter size-full wp-image-2600" />
</div>

<h3>comments.php</h3>
<hr />
WordPress fresh installed will come with the default theme and we can use some of those files to re-use. In default theme directory, open comments.php file, copy all the code then paste it to your new theme comments.php file. Use css to style the comment form and comments list. That's all we need for the comment template.

I recommend some tutorial that help you build a better comment:

<ul>
	<li><a href="http://www.instantshift.com/2009/02/08/30-most-wanted-wordpress-comments-page-hacks/" rel="nofollow" >30 Most Wanted WordPress Comments Page Hacks</a></li>
	<li><a href="http://www.darrenhoyt.com/2007/08/18/styling-your-wordpress-comments/" rel="nofollow" >Styling Your Wordpress Comments</a></li>
	<li><a href="http://www.smashingmagazine.com/2009/07/23/10-wordpress-comments-hacks/" rel="nofollow" >10 Handy WordPress Comments Hacks</a></li>
</ul>

The most important when editing the comments.php file is DON'T FORGET to put these code before closing the comment form tag:

<pre class="html">
<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">comment_id_fields</span>(); <span style="color:#dd0000;">?&gt;</span>
<span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">do_action</span>(<span style="color:#eb7300;">'comment_form'</span>, <span style="color:#825900;">$post</span>-&gt;ID); <span style="color:#dd0000;">?&gt;</span>
</pre>

With <em>page.php</em> file to display pages, we are good to use the same code of <em>single.php</em> file because the in fact, page is a post.

<h3>Conclusion</h3>
This tutorial doesn't guide you to build a completed WordPress theme, but at least it makes the WordPress Theme FrozenFlirt works with some basic function such as: view post, view index page, archive pages, comments.... If you need to build a completed theme with all of function you will need do more. The great place and my recommend website to learn how to mastering WordPress theme is <a href="http://codex.wordpress.org/Main_Page" rel="nofollow" >WordPress Codex</a>. Hope you guys design great WordPress theme from this tutorial. Any suggestion helps this tutorial more completed will be appreciated.

<p>Related posts:<ol><li><a href='http://aext.net/2009/12/wordpress-theme-from-scratch-%e2%80%93-day-2-psd-to-html/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 2: PSD to HTML'>WordPress Theme from Scratch – Day 2: PSD to HTML</a></li>
<li><a href='http://aext.net/2009/12/wordpress-theme-from-scratch-day-1-psd/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch &#8211; Day 1: PSD'>WordPress Theme from Scratch &#8211; Day 1: PSD</a></li>
<li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>The Right Way To Build WordPress As A Community News</title>
		<link>http://aext.net/2010/01/the-right-way-to-build-wordpress-as-a-community-news/</link>
		<comments>http://aext.net/2010/01/the-right-way-to-build-wordpress-as-a-community-news/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 23:21:20 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[community news]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[RSS fetching]]></category>
		<category><![CDATA[TDO Mini Form]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Plugin]]></category>

		<guid isPermaLink="false">http://aext.net/?p=2484</guid>
		<description><![CDATA[WordPress is getting popular now and everyone is switching to use WordPress because we can build anything with WordPress: WordPress as a magazine, WordPress as a bulletin board, Video site ..... Today, I would like to put all my love for WordPress into this tutorial to explain how to build WordPress as a Community News, ... but in a right way.


Related posts:<ol><li><a href='http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 3: HTML to WordPress'>WordPress Theme from Scratch – Day 3: HTML to WordPress</a></li>
<li><a href='http://aext.net/2009/11/community-blog-should-or-should-not-i-run-this-way/' rel='bookmark' title='Permanent Link: Community Blog: Should Or Should not I Run This Way?'>Community Blog: Should Or Should not I Run This Way?</a></li>
<li><a href='http://aext.net/2009/10/wordpress-theme-design-with-options-adminstration/' rel='bookmark' title='Permanent Link: Wordpress Theme Design with Options Adminstration'>Wordpress Theme Design with Options Adminstration</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[WordPress is getting popular now and everyone is switching to use WordPress because we can build anything with WordPress: WordPress as a magazine, WordPress as a bulletin board, Video site ..... Today, I would like to put all my love for WordPress into this tutorial to explain how to build WordPress as a Community News, ... but in a right way.

<span id="more-2484"></span>

In WordPress, the popular plugin for us to build community news submission is <strong><a href="http://wordpress.org/extend/plugins/fv-community-news/" rel="nofollow" >FV Community News</a></strong> which is being used on a lot of blog pages. This plugin is really useful to add related articles from other blogs to your sidebar. Adding them manually takes lots of time we don't have.  However, <strong>FV Community News</strong> stores submissions in another table in database. That's the problem now for someone want to build a community website where everyone can submit their news to. You can check some design community news website such as: <a href="http://www.webdesign-ne.ws/" rel="nofollow" >webdesign-ne.ws</a>, <a href="http://design-newz.com/" rel="nofollow" >design-newz.com</a>, <a href="http://scriptandstyle.com/" rel="nofollow" >scriptandstyle.com</a>... or check my second website at <a href="http://whofreelance.com" rel="nofollow" >whofreelance.com</a>. They and I are not using FV Community News to handle users submissions. The plugin on these websites is <a href="http://wordpress.org/extend/plugins/tdo-mini-forms/" rel="nofollow" >TDO Mini Forms</a> because TDO Mini Form help users submit their posts as WordPress posts.
<h3>1. Setting up your TDO Mini Form.</h3>
<hr />First, very simple, download this plugin in zip format and extract the files to a subdirectory, called tdo-mini-forms, of your plugin directory. i.e. <em>/path_to_wordpress/wp-content/plugins/tdo-mini-forms</em>. Then, go to plugin menu in WordPress Admin and active it. Make sure you then configure it via the main TDOMF menu in the Wordpress Administration backend.

I would like to forward you a link to <a href="http://thedeadone.net/blog/tutorial-video-for-tdo-mini-forms/" rel="nofollow" >Tutorial Video for TDO Mini Forms! </a>. The video is pretty good too as it shows you how to create a submission form and an edit form.

And after you know how to use the TDO Mini Form, create a submit page with the form as below:
<div class="smallimage"><img class="aligncenter size-full wp-image-2491" title="TDO Form Configuration" src="http://aext.net/wp-contents/uploads/2010/01/TDO-Form-Configuration-e1262497965484.png" alt="" width="500" height="268" /></div>
Create new page item in Wordpress Admin and name its title as "News Submission". In my case on <a href="http://whofreelance.com" rel="nofollow" >whofreelance.com</a>, the permalink for this page is <em>http://whofreelance.com/news-submission/</em>. After that, type something about the the copyright or something like the rules for submission. Don't forget to implement the form to this page by put this code below:
<pre>[tdomf_form1]
</pre>
And this is what you get:
<div class="smallimage"><img class="aligncenter size-full wp-image-2493" title="News Submission WhoFreelance Web Development News" src="http://aext.net/wp-contents/uploads/2010/01/News-Submission-WhoFreelance-Web-Development-News.png" alt="" width="500" height="550" /></div>
Now, at this step, you already done for the community website that publish users's news submissions. No more step required for doing like all of the community design news websites I referred at the beginning of this post.

If you have not only one website or blog, and you want to display these submissions on another websites, the best way is fetching rss feed from it. However, the problem is you cannot get the direct urls to original posts because we save the users's post urls as post meta tags. B default, post meta tags were not included in the feed. You might have a little confusing because <a href="css-tricks.com" rel="nofollow" >css-tricks.com</a> is fetching the news from scriptandstyle, or you can see I'm doing the same with <a href="http://aext.net">AEXT.NET</a> which are fetching users's submission on <a href="http://whofreelance.com" rel="nofollow" >whofreelance.com</a>. That's why you need to go to next step.
<h3>2. Modify the feed of the submissions.</h3>
<hr />Each post when submitted to your WordPress will appear on your feed, right? Someone will say: <em>"Hey, it's easy, I have the feed here, I can fetch rss and display the submissions on other websites"</em>. The answer is <em>"Yes, you can"</em>. However, you can just only fetch the post title, post url or anything is belong to the article submitted except post meta tags. Refer to the first image above, I highlighted the post_url meta tags because it will be the most important part of community news.

ScriptandStyle published a post explains how to <a href="http://scriptandstyle.com/add-custom-xml-wordpress-rss-feed" rel="nofollow" >Add Custom Values To Your WordPress RSS Feed</a>. That would be a good solution for you to put post meta tags to the feed, right? This hack will work. However, you will realize  that everything (your changes) will be lost when you update WordPress.

Here is better solution. In your WordPress Admin, create another page. <em>What's the heck this page for?</em> For your feed. Because you will lose your changes when you update WordPress if you hack into feed-atom.php file. So, why don't you create your own rss file and put it into your template folder, and create a new page in WordPress Admin with the content is the content of rss file? Everything will be fine if you update WordPress or not.



Simple as I did, in your theme directory, create new file name it "communty-feed.php" or something you like (just keep it in secret), then copy all the content of <em>feed-atom.php</em> in wp-includes folder and paste into your new file you have just created.

<strong style="color: red;">Important:</strong> Insert these code at the head of this file.
<pre>&lt;?php
  /*
  Template Name: Community Feed
  */

$numposts = 10;
$posts = query_posts('showposts='.$numposts);
</pre>

Without query the posts and number of posts to display, the content of your new feed file will be empty and only the title of page will appear in the feed.

<div class="bigimage"><img class="aligncenter size-full wp-image-2498" title="News Submission WhoFreelance Web Development News Feed" src="http://aext.net/wp-contents/uploads/2010/01/News-Submission-WhoFreelance-Web-Development-News-Feed.png" alt="" width="500" height="389" /></div>

Set the Template Name on the head will help WordPress recognise the file, so that you can create new page in Wordpress admin with the template is this page. Furthermore, add the direct url to your feed by put these code within the entry tag.

<pre class="html">
&lt;entry&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;author&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;&lt;?php the_author() ?&gt;&lt;/name&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;uri&gt;&lt;?php the_author_meta('url')?&gt;&lt;/uri&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php endif; ?&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/author&gt;

&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="color:#236e25;">&lt;!-- this is what we add --&gt;</span></em> &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;directurl&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#003369;">get_post_meta</span>(<span style="color:#825900;">$post</span>-&gt;ID,<span style="color:#eb7300;">'post_url'</span>,<span style="color:#881350;">true</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/directurl&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&lt;title type=&quot;&lt;?php html_type_rss(); ?&gt;&quot;&gt;&lt;![CDATA[&lt;?php the_title_rss() ?&gt;]]&gt;&lt;/title&gt;
</pre>

 To set this page as page template, following this image:

<div class="bigimage"><img class="aligncenter size-full wp-image-2499" title="News Submission WhoFreelance Web Development News Page template" src="http://aext.net/wp-contents/uploads/2010/01/News-Submission-WhoFreelance-Web-Development-News-Page-template.png" alt="" width="501" height="413" /></div>
And now, you are fine with the feed, you will not see the post meta tags in any feed readers, but the feed still work like original feed.

<h3>Fetching feed on other websites</h3>
<hr />
All the feed have the same basic structure. Each feed has its children tags, and in this case, our feed is:
<div class="smallimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/News-Submission-WhoFreelance-Web-Development-News-Feed-Elements-e1262506882462.png" alt="" title="News Submission WhoFreelance Web Development News Feed Elements" width="500" height="203" class="aligncenter size-full wp-image-2503" />
</div>

We will fetch only the title, published date, and the link to original post of each item. In your <em>functions.php</em> file, create new function to fetch all the feed items. Remember that the total number of items will be fetched is 10 because we have limited the number of post displayed in our feed is 10 as above. Refer to the image right above, using <em>simplexml_load_file</em>, your function will look like:

<pre>function getFeed($feed_url) {
    $xml = simplexml_load_file($feed_url);
    echo "&lt;ul&gt;";

    foreach($xml-&gt;entry as $entry) {
         echo "&lt;li&gt;";
         echo "&lt;span class='post-date'&gt;Posted: ".date(  "F j, Y", strtotime($entry-&gt;published) )."&lt;/span&gt;";
         echo "&lt;h3&gt;&lt;a title='Permanent Link to ".$entry-&gt;title."' rel='nofollow' href='".$entry-&gt;directurl."'&gt;".$entry-&gt;title."&lt;/a&gt;&lt;/h3&gt;";
         echo "&lt;/li&gt;";
     }

     echo "&lt;/ul&gt;";

}
</pre>

In your sidebar, use this code to display the feed.

<pre>
&lt;?php getFeed(&quot;http://link-to-your-feed/&quot;); ?&gt;
</pre>

Your result:

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2010/01/News-Submission-WhoFreelance-Web-Development-News-Display-Feed.png" alt="" title="News Submission WhoFreelance Web Development News Display Feed" width="500" height="241" class="aligncenter size-full wp-image-2506" />
</div>

The feed can be display by different codes, this code is just an simple code I would like to put it into this tutorial.

Some code you will be interesting to take a look for example:

<ul>
	<li><a href="http://simplepie.org/wiki/plugins/wordpress/simplepie_core" rel="nofollow" >SimplePie Core for WordPress</a></li>
	<li><a href="http://net.tutsplus.com/videos/screencasts/how-to-read-an-rss-feed-with-php-screencast/#comment-125119" rel="nofollow" >How to Read an RSS Feed With PHP – screencast</a></li>	
       <li><a href="http://codex.wordpress.org/Function_Reference/fetch_feed" rel="nofollow" >Function Reference/fetch feed</a></li>
	<li><a href="http://net.tutsplus.com/videos/screencasts/how-to-read-an-rss-feed-with-php-screencast/#comment-125119" rel="nofollow" >How to: Display any rss feed on your WordPress blog</a></li>
</ul>

<h3>Conclusion</h3>
<hr />
You see? we can build anything from WordPress. The only problem is the better way to transform it and do it in a right way. I hope this tutorial will help you build a better web community news for news submission. I would appreciate all the comment the help the tut more completed.

<p>Related posts:<ol><li><a href='http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 3: HTML to WordPress'>WordPress Theme from Scratch – Day 3: HTML to WordPress</a></li>
<li><a href='http://aext.net/2009/11/community-blog-should-or-should-not-i-run-this-way/' rel='bookmark' title='Permanent Link: Community Blog: Should Or Should not I Run This Way?'>Community Blog: Should Or Should not I Run This Way?</a></li>
<li><a href='http://aext.net/2009/10/wordpress-theme-design-with-options-adminstration/' rel='bookmark' title='Permanent Link: Wordpress Theme Design with Options Adminstration'>Wordpress Theme Design with Options Adminstration</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2010/01/the-right-way-to-build-wordpress-as-a-community-news/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>The Nice Way To Mention Your Recent Articles in WordPress SideBar</title>
		<link>http://aext.net/2009/12/the-nice-way-to-mention-your-recent-articles-in-wordpress-sidebar/</link>
		<comments>http://aext.net/2009/12/the-nice-way-to-mention-your-recent-articles-in-wordpress-sidebar/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 20:53:42 +0000</pubDate>
		<dc:creator>Lam Nguyen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Theme Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Plugin]]></category>
		<category><![CDATA[Wordpress Sidebar]]></category>
		<category><![CDATA[Wordpress Theme]]></category>

		<guid isPermaLink="false">http://aext.net/?p=2301</guid>
		<description><![CDATA[People asked me how I mention my recent articles in WordPress sidebar by display post thumbnails and titles with a well-styled. Today, I would like to response their request. This way is being used in some blogs. I'm not sure if they are using the same method as mine, but at least we will get the same result.


Related posts:<ol><li><a href='http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 3: HTML to WordPress'>WordPress Theme from Scratch – Day 3: HTML to WordPress</a></li>
<li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
<li><a href='http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/' rel='bookmark' title='Permanent Link: How To Wrap Google Adsense In Wordpress Posts Correctly'>How To Wrap Google Adsense In Wordpress Posts Correctly</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[People asked me how I mention my recent articles in WordPress sidebar by display post thumbnails and titles with a well-styled. Today, I would like to response their request. This way is being used in some blogs. I'm not sure if they are using the same method as mine, but at least we will get the same result.

<span id="more-2301"></span>

<div class="bigimage">
<img src="http://aext.net/wp-contents/uploads/2009/12/Your-Recent-Articles-in-WordPress-SideBar.png" alt="How to mention your recent artices in Wordpress Sidebar the right way" />
</div>

When design blog theme in WordPress, I always look for non-using plugins solution. People asked me which plugin I'm using for this sidebar. No, the answer is NO. 

There are a lot of WordPress plugins to display your recent articles, popular articles to mention your posts in the sidebar widget. However, you forgot that you can do the same with a simple posts query using <em><a href="http://codex.wordpress.org/Function_Reference/WP_Query" rel="nofollow" >WP_Query();</a></em> function.

To begin, create new posts object that you will call by will <strong>have_posts()</strong> and display your posts within the loop

Example:

<pre>
$wp_query->have_posts();
</pre>

This function is called to see if there are any posts to show. Using the while loop, and we can use have_post() as the condition. This will iterate around as long as there are posts to show. 

In my case, I'm using iterations, the_post(), within the while loop to iterate around as long as there are posts to show.

<pre class="php">
<span style="color:#881280;">&lt;ul&gt;</span>

&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#825900;">$recent</span> = <span style="color:#881350;">new</span> <span style="color:#003369;">WP_Query</span>(<span style="color:#eb7300;">&quot;showposts=35&quot;</span>); <span style="color:#881350;">while</span>(<span style="color:#825900;">$recent</span>-&gt;<span style="color:#003369;">have_posts</span>()) : <span style="color:#825900;">$recent</span>-&gt;<span style="color:#003369;">the_post</span>();<span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;a </span><span style="color:#994500;">title</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;Permanent Link to </span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">rel</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;nofollow&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">href</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_permalink</span>() <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;">&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">if</span><span style="color:#003369;"> </span>(<span style="color:#003369;">get_post_meta</span>(<span style="color:#825900;">$post</span>-&gt;ID, <span style="color:#eb7300;">&quot;image&quot;</span>, <span style="color:#881350;">true</span>)): <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">/scripts/thumb.php?src=</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">echo</span> <span style="color:#003369;">get_post_meta</span>(<span style="color:#825900;">$post</span>-&gt;ID, <span style="color:#eb7300;">&quot;image&quot;</span>, <span style="color:#881350;">true</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&amp;w=25&amp;h=25&amp;zc=1&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">else</span>: <span style="color:#dd0000;">?&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;img </span><span style="color:#994500;">src</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">bloginfo</span>(<span style="color:#eb7300;">'template_url'</span>); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">/images/thumbnail.png&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">width</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;25&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">height</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;25&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">alt</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#1a1aa6;">&quot;</span><span style="color:#881280;"> /&gt;</span> &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endif</span>; <span style="color:#dd0000;">?&gt;</span>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;span&gt;</span><span style="color:#dd0000;">&lt;?php</span> <span style="color:#003369;">the_title</span>(); <span style="color:#dd0000;">?&gt;</span><span style="color:#881280;">&lt;/span&gt;&lt;/a&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/li&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;<span style="color:#dd0000;">&lt;?php</span> <span style="color:#881350;">endwhile</span>; <span style="color:#dd0000;">?&gt;</span>

<span style="color:#881280;">&lt;/ul&gt;</span>
</pre>

This code above will check if you have post meta name is <strong>image</strong>, it will display the thumbnail using <a href="http://code.google.com/p/timthumb/" rel="nofollow" >timthumb</a> script. Timthumb is a small php script for cropping, zooming and resizing web images (jpg, png, gif). Perfect for use on blogs and other applications.



You can change the number of post will be displayed and set the condition to display number of posts in single page larger than other page because the post page is always longer than others, right?

CSS Bonus:

<pre class="css">
.widget ul {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">list-style-type</span>:<span style="color:#9b4400;">none</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">margin</span>:<span style="color:#0000ff;">5px</span> <span style="color:#9b4400;">auto</span> <span style="color:#0000ff;">8px</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">padding</span>:<span style="color:#0000ff;">0 0 2px</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">width</span>:<span style="color:#9b4400;">auto</span>;
}

.widget ul li {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">clear</span>:<span style="color:#9b4400;">both</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">letter-spacing</span>:<span style="color:#0000ff;">0</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">margin</span>:<span style="color:#0000ff;">0</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">padding</span>:<span style="color:#0000ff;">5px</span> <span style="color:#0000ff;">0 0</span>;
}

.widget ul li a {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">border-bottom</span>:<span style="color:#0000ff;">0 </span><span style="color:#9b4400;">dotted</span> <span style="color:#760f15;">#DDDDDD</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">color</span>:<span style="color:#760f15;">#333333</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">font-family</span>:Georgia,<span style="color:#760f15;">&quot;Nimbus Roman No9 L&quot;</span>,<span style="color:#9b4400;">serif</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">font-size</span>:<span style="color:#0000ff;">11px</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">font-weight</span>:<span style="color:#9b4400;">normal</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">margin</span>:<span style="color:#0000ff;">0</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">padding</span>:<span style="color:#0000ff;">0</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">text-decoration</span>:<span style="color:#9b4400;">none</span>;
}

.widget ul li img {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">border</span>:<span style="color:#0000ff;">3px</span> <span style="color:#9b4400;">solid</span> <span style="color:#760f15;">#DFDFDF</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">float</span>:<span style="color:#9b4400;">left</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">margin-bottom</span>:<span style="color:#0000ff;">10px</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">margin-right</span>:<span style="color:#0000ff;">10px</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">padding</span>:<span style="color:#0000ff;">1px</span>;
}

.widget ul li span {
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">display</span>:<span style="color:#9b4400;">block</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#88134f;">padding</span>:<span style="color:#0000ff;">0</span>;
}
</pre>

<h3>Conclusion</h3>
<hr />
We don't need to use any plugin for display not only such a simple list of post like that but also other simple things in WordPress. Wordpress provide us <a href="http://codex.wordpress.org/" rel="nofollow" >WordPress Codex</a> which contains a thousand of Function References. If you want to build your own WordPress theme with unique style, the first thing you need is check out how WordPress function works. Good luck, hope see more beautiful WordPress themes from the web community.

<p>Related posts:<ol><li><a href='http://aext.net/2010/01/wordpress-theme-from-scratch-day-3-html-to-wordpress/' rel='bookmark' title='Permanent Link: WordPress Theme from Scratch – Day 3: HTML to WordPress'>WordPress Theme from Scratch – Day 3: HTML to WordPress</a></li>
<li><a href='http://aext.net/2009/10/wordpress-hack-anything-can-be-added-anywhere-in-the-post-content/' rel='bookmark' title='Permanent Link: Wordpress Hack: Anything Can Be Added Anywhere In The Post Content'>Wordpress Hack: Anything Can Be Added Anywhere In The Post Content</a></li>
<li><a href='http://aext.net/2010/01/how-to-wrap-google-adsense-in-wordpress-posts-correctly/' rel='bookmark' title='Permanent Link: How To Wrap Google Adsense In Wordpress Posts Correctly'>How To Wrap Google Adsense In Wordpress Posts Correctly</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://aext.net/2009/12/the-nice-way-to-mention-your-recent-articles-in-wordpress-sidebar/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>
