<?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"
	>

<channel>
	<title>Developer Tutorials' Webmaster Blog &#187; code</title>
	<atom:link href="http://www.developertutorials.com/blog/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.developertutorials.com/blog</link>
	<description>Keeping webmasters up-to-date on technology.</description>
	<pubDate>Tue, 02 Sep 2008 14:59:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Create a Custom Firefox Search Tool in Five Minutes</title>
		<link>http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/</link>
		<comments>http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 13:47:16 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/</guid>
		<description><![CDATA[site:yourblogname.com searchterm
This is an example how to search your blog as a query in Google.  But have you ever wanted to learn how to make your own &#8216;Search Tools&#8217; for Firefox so that you can look-up information on your own blog quickly, from anywhere on the internet? Or do you want to hack Google [...]]]></description>
			<content:encoded><![CDATA[<p><code>site:yourblogname.com searchterm</code></p>
<p>This is an example how to search your blog as a query in Google.  But have you ever wanted to learn how to make your own &#8216;Search Tools&#8217; for Firefox so that you can look-up information on your own blog quickly, from anywhere on the internet? Or do you want to hack Google Custom search to improve your earnings and it&#8217;s functionality?</p>
<p><a href='http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-13.png'><img src="http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-13-300x104.png" alt="" width="300" height="104" class="alignnone size-medium wp-image-327" /></a></p>
<p><span id="more-325"></span></p>
<p>It turns out making a search tool is relatively simple.  In fact using <a href="http://ready.to/search/en/#">this tool</a>, you can make one in about five minutes.  The trick is to figure out what a search query on your blog looks like.  For Wordpress users, it might look like this:</p>
<p><code>http://yourblog.com/blog/?s=news&amp;search=Search</code></p>
<p>This is important because you&#8217;ll notice the form asks you for a <strong>front of search term</strong> and a <strong>back of search term</strong>.  The query itself should be left out so that your users can enter whatever they want.  Let&#8217;s dissect the search query&#8230;.</p>
<p>FRONT<br />
<code>http://yourblog.com/blog/?s=</code></p>
<p>QUERY<br />
<code>news</code></p>
<p>BACK<br />
<code>&amp;search=Search</code></p>
<p>Your own search queries may look a bit different than this depending upon the software you use.  To get the query preform a search using the GUI and then copy and paste the query from the navigation bar.  </p>
<p><a href='http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-2.png'><img src="http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-2-300x24.png" alt="" width="300" height="24" class="alignnone size-medium wp-image-326" /></a></p>
<p>If you&#8217;re using Google custom search, you&#8217;ll notice that the query looks very different.  This is because they use identifiers to keep track of revenues earned from custom search.  Now, I have no idea if hacking their custom code is a violation of TOS but I&#8217;ve done it, it works but since it&#8217;s questionable I can&#8217;t flat out explain what to do here.  Instead, we&#8217;ll create one using the Wordpress specific query&#8230;.</p>
<p><a href='http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-81.png'><img src="http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-81-300x213.png" alt="" width="300" height="213" class="alignnone size-medium wp-image-328" /></a></p>
<p>Ready.to then creates the XML file needed to add custom search to your top navigation bar.  You can see where it puts the tool below:</p>
<p><a href='http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-71.png'><img src="http://www.developertutorials.com/blog/wp-content/uploads/2008/07/picture-71-253x300.png" alt="" width="253" height="300" class="alignnone size-medium wp-image-330" /></a></p>
<p>Notice that I now have custom search option added to my Firefox Toolbar.  That&#8217;s great, you&#8217;ve got an XML file, however if you upload the file to your blog and link to it, Firefox won&#8217;t know to execute the script.  To do that you need to add a bit of javascript code to the header of your site and use another custom query for linking.</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
function addp(csurl) {<br />
try {<br />
window.external.AddSearchProvider(csurl);<br />
} catch (e) {<br />
alert("You need to use Internet Explorer (7.0 or later)<br />
or Firefox (2.0 or later) to install the OpenSearch plug-in.");<br />
}}<br />
//--&gt;<br />
&lt;/SCRIPT&gt;</code></p>
<p>That script tells the browser what to do with the .xml file.  Now we need to tell Firefox where to find it, and that it&#8217;s an executable and not just a linked file.  We do this with the <strong>addp</strong> request defined in the header script&#8230;</p>
<p><code><br />
&lt;a href="#" onClick="addp(&quot;http://developertutorials.com/blog/DevTut.xml&quot;);"&gt;</code></p>
<p>This tells the browser that the file is executable, the script tells FireFox what to do with that executable (add it to the toolbar).</p>
<p>That&#8217;s it, if everything went well you&#8217;ve created a custom search tool for Firefox in about five minutes.  You can get the Developer Tutorial Firefox Search Tool <a href="http://appfrica.net/blog/test145">here</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d325" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/&amp;title=Create+a+Custom+Firefox+Search+Tool+in+Five+Minutes" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/&amp;title=Create+a+Custom+Firefox+Search+Tool+in+Five+Minutes" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/&amp;title=Create+a+Custom+Firefox+Search+Tool+in+Five+Minutes" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/general/create-a-custom-firefox-search-tool-in-five-minutes-325/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing and Coding a Wordpress Theme From Scratch (Part 9)</title>
		<link>http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/</link>
		<comments>http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 21:16:42 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Photoshop]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[layout]]></category>

		<category><![CDATA[photshop]]></category>

		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/</guid>
		<description><![CDATA[Going From Photoshop to XHTML to Wordpress Theme.  In this multi-part series I'll detail how to create and design a Wordpress theme in Photoshop and take it from just an idea to fully coded.
]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/">Part 2</a> - &#8220;Layout And Structure&#8221; and &#8220;Designing Wordpress Themes in Photoshop&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/">Part 3</a> - &#8220;Photoshop to XHTML in 24 Hours&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/">Part 4</a> - &#8220;Cleaning Up Your XHTML&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/javascript/designing-and-coding-a-wordpress-theme-from-scratch-part-5-149/">Part 5</a> - &#8220;Preloading Images with Javascript and CSS&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-6-151/">Part 6</a> - &#8220;Marking Up is Hard to Do&#8221; and &#8220;The Anatomy of a Wordpress Theme&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-7-153/">Part 7</a> - &#8220;Beginning with PHP for Wordpress&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/">Part 8</a> - &#8220;Putting the Press in Wordpress with PHP&#8221;</p>
<p>Because Wordpress is fundamentally a PHP system we can add a few snippets of code to make our header, footer and sidebar files dynamic. </p>
<p><b>Marking Up Header.php</b></p>
<p>Your blog header file usually contains the title of your site linked to the homepage.  In an HTML page we would simply add text or place an image and link to the homepage using &lt;a href=&#8221;"&gt;&lt;/a&gt;.  The key to making our Wordpress theme, however, is we need to make all our links relative so that the end user can install the theme and use it with their own unique site with as little fuss as possible.  It should <i>just work</i>.</p>
<p><span id="more-159"></span></p>
<p>How is this done?  We use PHP requests to request and print the blog title allowing it to be dynamically relative to the database.</p>
<p>The code for a text blog title:</p>
<pre>
	&lt;div class="blogtitle"&gt;&lt;a href="&lt;?php bloginfo('url'); ?&gt;/"&gt;
	&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;/div&gt;
</pre>
<p>The code for an image blog title:</p>
<pre>
	&lt;div class="blogtitle"&gt;&lt;a href="&lt;?php bloginfo('url'); ?&gt;/"&gt;
	&lt;img src="your/image/path.jpg" title="&lt;?php bloginfo('name'); ?&gt;" /&gt;
	&lt;/a&gt;&lt;/div&gt;
</pre>
<p>These are the only two codes we need to place in our header.php file.  In my case I needed to request other PHP documents that are meant to be displayed before the document continues: the sidebar and the center rotating headline areas. I this did using this code:</p>
<pre>
	&lt;?php require('yourphpfile.php'); ?&gt;
	&lt;?php get_sidebar(); ?&gt;
</pre>
<p>Still confused?  The image below contains a region map of my theme&#8217;s <strong>index.php</strong> as it displays in a browser.  The red region represents &#8220;header.php&#8221;, the purple region represents &#8220;center.php&#8221;, the blue region represents &#8220;sidebar.php&#8221; and the green is the post area, the code for which is contained in index.php.  </p>
<p><img src="http://farm3.static.flickr.com/2198/2454229161_0db7a57ec1.jpg"></p>
<p>Because the format of my blog is unique to my design this may not apply to your own design, I just want to make sure everything is throughly explained so that when you download my theme in <a href="http://www.developertutorials.com/blog/php/designing-and-…cratch-part-10designing-and-coding-a-wordpress-theme-from-scratch-part-10-160/" target="_blank" title="photoshop to wordpress">Part 10</a> you&#8217;ll understand how everything works.</p>
<p><b>Marking Up Footer.php</b></p>
<p>Footer.php is even easier because there&#8217;s no crucial PHP requests that need to go here to make it function.  This means it can be entirely HTML or you can add a dynamic request for the blog title like you did above.  You may want to try something like this:</p>
<pre>
	&lt;div class="footer"&gt;©2008 &lt;a href="&lt;?php bloginfo('url'); ?&gt;/"&gt;
	&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;/div&gt;
</pre>
<p>&#8230;which would simply display the copyright and year followed by the blog title.</p>
<p><b>Marking Up Sidebar.php</b></p>
<p>Sidebar.php is essentially the same in that it can contain nothing more than HTML or it can also contain PHP queries.  Here are some popular PHP queries often used in sidebar.php:</p>
<pre>
	&lt;strong&gt;Display the Blogroll:&lt;/strong&gt;
	&lt;?php get_links_list(); ?&gt;

	&lt;strong&gt;Display the pages of the site:&lt;/strong&gt;
	&lt;?php wp_list_pages('title_li=&lt;h2&gt;Pages&lt;/h2&gt;'); ?&gt;

	&lt;strong&gt;Display the site's categories:&lt;/strong&gt;
	&lt;?php wp_list_cats(); ?&gt;
</pre>
<p>I recommend reading <a href="http://codex.wordpress.org/Customizing_Your_Sidebar" target="_blank">&#8220;Customizing Your Sidebar&#8221;</a> if you&#8217;d like to explore your options a bit more.  In <a href="http://www.developertutorials.com/blog/php/designing-and-…cratch-part-10designing-and-coding-a-wordpress-theme-from-scratch-part-10-160/" target="_blank" title="photoshop to wordpress theme">Part 10</a> we&#8217;ll create the other pages of our theme and then we&#8217;ll learn all about<a href="http://www.developertutorials.com/blog/php/packaging-a-wordpress-theme-for-distribution-162/" target="_blank" title="Packaging a Wordpress Theme for Distribution">&#8220;Packaging a Wordpress Theme for Distribution&#8221;</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d159" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+9%29" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+9%29" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+9%29" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-9-159/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing and Coding a Wordpress Theme From Scratch (Part 8)</title>
		<link>http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/</link>
		<comments>http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 19:44:44 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/</guid>
		<description><![CDATA[Going From Photoshop to XHTML to Wordpress Theme.  In this multi-part series I'll detail how to create and design a Wordpress theme in Photoshop and take it from just an idea to fully coded.
]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/">Part 1</a> - &#8220;Tools For The Task&#8221; and &#8220;Preparation&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/">Part 2</a> - &#8220;Layout And Structure&#8221; and &#8220;Designing Wordpress Themes in Photoshop&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/">Part 3</a> - &#8220;Photoshop to XHTML in 24 Hours&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/">Part 4</a> - &#8220;Cleaning Up Your XHTML&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/javascript/designing-and-coding-a-wordpress-theme-from-scratch-part-5-149/">Part 5</a> - &#8220;Preloading Images with Javascript and CSS&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-6-151/">Part 6</a> - &#8220;Marking Up is Hard to Do&#8221; and &#8220;The Anatomy of a Wordpress Theme&#8221;<br />
<a target="_blank" href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-7-153/">Part 7</a> - &#8220;Beginning with PHP for Wordpress&#8221;</p>
<hr />
<b>Putting the Press in WordPress with PHP</b></p>
<p>Wordpress is <i>a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability</i> as the makers proudly proclaim at <a target="_blank" href="http://wordpress.org">wordpress.org</a>.  The keyword there being &#8216;publishing&#8217; and the most important part of the Wordpress publishing engine is the element that allows content to be published online easily and automatically.  This element is called the <strong>the loop</strong>.</p>
<p><span id="more-154"></span></p>
<p>While I can&#8217;t get into all the operational mechanics of how Wordpress works here, I can refer you to a page that does offer more in depth analysis (<a href="http://codex.wordpress.org" target="_blank">here</a>).  What is important to this tutorial is that the Wordpress theme we designed in Photoshop needs this PHP function (along with a few others) to correctly fetch content from the database.  Let&#8217;s examine four critical functions:</p>
<pre>
&lt;?php query_posts();?&gt;
<strong>Requests the database of content, should be placed near the top of index.php
just after the request &lt;?php get_header(); ?&gt;</strong>

&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
<strong>this is The Loop and it should be placed prior to
where you want your content to print</strong>

&lt;?php the_content(''); ?&gt;
<strong>Calls and prints the content of your blog according to the settings in the
admin section or php functions called before it.  This should be placed wherever
you want your blog posts to go within the &lt;div&gt; tags.</strong>

&lt;?php endif; ?&gt;
<strong>Closes the loop.</strong>
</pre>
<p>Using the code from <a href="http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-7-153/">Part 7</a> as an example:</p>
<pre>
&lt;?php get_header(); ?&gt;
&lt;?php query_posts();?&gt;

    &lt;/div&gt;

	&lt;div id="post"&gt;
	  &lt;div class="entry"&gt;
	&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;

		&lt;div class="posts"&gt;
	&lt;?php the_excerpt(''); ?&gt;
     		&lt;/div&gt;   

	&lt;?php endif; ?&gt;
	  &lt;/div&gt;
     &lt;/div&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>You may notice that the &lt;div&gt; tags with <strong>id</strong>  and <strong>class=&#8221;posts&#8221;</strong>elements.  These are styling anything they contain. My <strong>id=&#8221;post&#8221;</strong> is printing my photoshoped content area.  The area with <strong>id=&#8221;class&#8221;</strong> is formating how my content will be formated.  Do I want to justify text?  Do I want to use a text-transform on the first letter?  Change the color of text?  All those types of styles should be applied to this class to be passed on to the text inside the container.</p>
<p>These three lines alone are essentially all you need for index.php in your theme.  However, you&#8217;ll notice that we&#8217;re missing a few important items.  We need to call and style the posts name, permalink, and meta data individually.  This means we need to add the following:</p>
<pre>
&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
<strong>Requests the post tile and links to it. Place this before the post content.</strong>

&lt;?php the_time('F j, Y'); ?&gt; at &lt;?php the_time('g:i a'); ?&gt;
&lt;?php comments_popup_link('| No Comments', '| 1 Comment;', '| % Comments;'); ?&gt;
<strong>Requests various types of information related to the post.  Place this just after the previous line.</strong>

&lt;?php the_category(', ') ?&gt; &lt;?php the_tags('| Tags: ', ', ', ''); ?&gt;
&lt;?php edit_post_link('| Edit', '', ''); ?&gt;&lt;/p&gt;
<strong>This calls the footer meta information for each individual post.
Place this after the content but before you close the loop.</strong>
</pre>
<p>After placing these codes my index.php looks something like this:</p>
<pre>
&lt;?php get_header(); ?&gt;
&lt;?php query_posts("showposts=2");?&gt;

	&lt;div id="post"&gt;
	&lt;div class="entry"&gt;
		&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;

   	&lt;span class="postname"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;"&gt;&lt;?php
 the_title(); ?&gt;&lt;/a&gt;&lt;/span&gt;

    	&lt;p class="postinfo"&gt;

		&lt;?php the_time('F j, Y'); ?&gt; at &lt;?php the_time('g:i a'); ?&gt; &lt;?
php comments_popup_link('| No Comments', '| 1 Comment;', '| % Comments;'); ?&gt;&lt;/p&gt;

	&lt;div class="posts"&gt;
    		&lt;?php the_content(''); ?&gt;
         	&lt;p class="postinfo"&gt;Posted in &lt;?php the_category(', ') ?&gt; &lt;?php
 the_tags('| Tags: ', ', ', ''); ?&gt; &lt;?php edit_post_link('| Edit', '', ''); ?&gt;
&lt;/p&gt;

     	&lt;/div&gt;   

		&lt;?php endif; ?&gt;
	&lt;/div&gt;
	&lt;/div&gt;

    		&lt;?php get_footer(); ?&gt;
</pre>
<p>In Part 9 we&#8217;ll be discussing how to correctly markup header.php, footer.php and footer.php and in Part 10 we&#8217;ll create the other pages Wordpress needs.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d154" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+8%29" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+8%29" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+8%29" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/php/designing-and-coding-a-wordpress-theme-from-scratch-part-8-154/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing and Coding a Wordpress Theme From Scratch (Part 4)</title>
		<link>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/</link>
		<comments>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 21:23:17 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Photoshop]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[Development]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[tut]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/</guid>
		<description><![CDATA[Going From Photoshop to XHTML to Wordpress Theme.  In this multi-part series I'll detail how to create and design a Wordpress theme in Photoshop and take it from just an idea to fully coded.
]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve gone from Photoshop PSD to slices to XHTML using Parts <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/">1</a>, <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/">2</a>, and <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/">3</a> but if the end result is a Wordpress theme the majority of the work still has to be done.  First of all it&#8217;s important to understand one bit of the operational mechanics of Wordpress.  Wordpress looks for certain information the header of a file called style.css, this is how it can tell themes apart. Here&#8217;s a better explanation from <a href="http://codex.wordpress.org/Theme_Development">Codex</a>:</p>
<blockquote cite="http://codex.wordpress.org/Theme_Development"><p>In addition to CSS style information for your theme, the stylesheet, style.css must provide details about the Theme in the form of comments. No two Themes are allowed to have the same details listed in their comment headers, as this will lead to problems in the Theme selection dialog. If you make your own Theme by copying an existing one, make sure you change this information first.</p>
</blockquote>
<p>Thus, we need to separate our inline CSS and put it in a separate file called style.css</p>
<p><span id="more-147"></span></p>
<p><b>Cleaning up Your XHTML</b></p>
<p>Let&#8217;s start by creating a blank document called style.css in the same directory as your HTML file. Open the CSS file and add the following information:</p>
<pre>/*
Theme Name: your-themes-name
Theme URI: the-theme's-homepage
Description: a-brief-description
Author: your-name
Author URI: your-URI
Template: use-this-to-define-a-parent-theme--optional
Version: a-number-optional

General comments/License Statement if any.
*/</pre>
<p>like so</p>
<p><img src="http://farm3.static.flickr.com/2375/2450107644_8959118e9c.jpg"></p>
<p>Now let&#8217;s open the HTML file the Photoshop created for us which should look something like <a href="http://flickr.com/photos/ww4f/2450125002/" title="click to see the document" rel="_blank">this</a>.<br />
The inline document is essentially divided for us already because everything between the &lt;style&gt; and &lt;/style&gt; tags is going to be cut out of our html document and pasted into the CSS document just after the heading we just added.  Let&#8217;s do that now, copy the style data out of the HTML document and into the CSS document and make sure that you close the tags once you&#8217;ve done so.</p>
<p>The resulting HTML file should now look like this:</p>
<p><img src="http://farm4.static.flickr.com/3193/2449334405_fdf4aff807.jpg"></p>
<p>and the CSS file like this:</p>
<p><img src="http://farm3.static.flickr.com/2111/2449334337_3183c10b1a.jpg"></p>
<p>Got it?  Now lets do some major cleaning.  Now that we&#8217;ve removed the style from our HTML we need to add it back.  We&#8217;re going to replace the empty &lt;style&gt; tags with the following line:</p>
<pre>&lt;link rel="stylesheet" href="style.css" type="text/css" media="screen" /&gt;</pre>
<p>This line is telling our document some very useful information:</p>
<ol>
<li>rel - the relationship of the linked document to the current document</li>
<li>href - the url to the linked document</li>
<li>type - the MIME (Multipurpose Internet Mail Extension) type of the target URL</li>
<li>media - denotes on which device the document is meant to be displayed</li>
</ol>
<p>or the translation for humans: &#8220;Hello, the text file that lives at this URL is a stylesheet that was made for use with documents that would be displayed on computer monitors and screens.&#8221;</p>
<p>We have to do this because we&#8217;ve taken out the style information but since we still want to style our HTML document we have to tell it where the style information now lives.  Next we want to empty all our &lt;div&gt; tags. </p>
<p>Since all our our photoshop images are essentially background images any line from our HTML document that looks like this:</p>
<pre>
   &lt;div id="aqua-01_"&gt;
	&lt;img id="yourfilename_01" src="yourfilename_01.png" width="549"
                  height="126" alt="" /&gt;
   &lt;/div&gt;
</pre>
<p>Should be changed to look like this:</p>
<pre>
	&lt;div id="aqua-01_"&gt;
	&lt;/div&gt;
</pre>
<p>But only when you change the corresponding ID container the CSS document to look like this:</p>
<pre>
	#aqua-01_ {
	position:absolute;
	left:0px;
	top:0px;
	width:549px;
	height:126px;
	background:url(images/aqua_01.png);
	}
</pre>
<p>What we&#8217;ve done is taken the image out of the &lt;div&gt; container in our HTML document and placed in the corresponding ID container in CSS.  This is important because now we can put other things like text or other images into the HTML files &lt;div&gt; container.  This will also allow our page to structure itself properly even if a few images are slow to load.</p>
<p>Finally we want to take anything that is an image and place it in a folder called &#8220;img&#8221; or &#8220;images&#8221;.  If you look at the code above I&#8217;m telling the CSS to look for image files in a folder called &#8220;images&#8221;.  We want to do this for organizational purposes.  Of course this is entirely optional but it&#8217;s good practice and somewhat of an organizational standard.</p>
<p>Are you still confused?<br />
<a href='http://www.developertutorials.com/blog/wp-content/uploads/2008/04/html_css.zip'>Download these files</a> and examine them to see if you can figure out what I did to make the page render properly.</p>
<p>In the next lesson we&#8217;re going learn how to optimize our page for speed using javascript.  Sweating yet? Don&#8217;t worry we&#8217;re already a lot closer than when we started!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d147" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+4%29" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+4%29" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+4%29" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing and Coding a Wordpress Theme From Scratch (Part 3)</title>
		<link>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/</link>
		<comments>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 18:07:57 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Photoshop]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[markup]]></category>

		<category><![CDATA[photoshop]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/</guid>
		<description><![CDATA[Going From Photoshop to XHTML to Wordpress Theme.  In this multi-part series I'll detail how to create and design a Wordpress theme in Photoshop and take it from just an idea to fully coded.
]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just started our first Wordpress theme! In <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/" target="_blank">Part 1</a> and <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/" target="_blank">Part 2</a> we reviewed some techniques that will allow our design to be marked up to XHTML.  In this lesson you&#8217;ll learn exactly how to do this and why it isn&#8217;t exactly as easy as it seems.</p>
<p><b>Photoshop to XHTML in 24 Hours</b></p>
<p>So we&#8217;ve all seen those ads for websites that say they can &#8220;Photoshop to XHTML/CSS in X Ammount of time&#8221; right?  No?  well here&#8217;s <a>39 of them</a>.  What exactly are these service doing that you can&#8217;t as the theme designer?  Nothing.  If you feel so inclined, save yourself the fee (usually around $100 or so dollars) and do it yourself!</p>
<p><span id="more-146"></span></p>
<ul>
<li>1. Select <strong>File &gt; Save For Web and Devices</strong></li>
<p><img src="http://farm3.static.flickr.com/2042/2449793616_c384832f18_m.jpg"></p>
<li>2. Click the arrow in the top right to optimize your websites color and download time. I usually don&#8217;t optimize for anything slower than 56Kbps because I use another technique which you&#8217;ll find out about in <a href="">Part 4</a>.</li>
<p><img src="http://farm3.static.flickr.com/2245/2448968481_778ca9c6ae_m.jpg"></p>
<li>3. Under preset select whether you want to use PNG, JPEG, or GIF formats and the various quality settings for each.</li>
<li>4. Click &#8220;Save&#8221;.</li>
<li>5. A window will pop up.  Here You want to set <strong>Format</strong> to &#8220;HTML and Images&#8221;.  Under settings select <strong>Other</strong></li>
<p><img src="http://farm3.static.flickr.com/2119/2448968435_e2a0865c04.jpg"></p>
<li>6. You&#8217;re going to set four options.  For <strong>HTML</strong> you want to make sure &#8216;Output XHTML&#8217; is selected. For <strong>Slices </strong>you want to make sure &#8216;Generate CSS&#8217; is selected instead of &#8216;Generate Table&#8217;.  Skip the remaining two options Background and Saving Files, they aren&#8217;t particularly necessary.
<p><img src="http://farm3.static.flickr.com/2036/2448968389_e90527cc8a.jpg" alt="psd to xhtml">&gt;</li>
<li>7. Save the file, navigate to and open the resulting HTML file in your text editor.  You&#8217;ll notice that Photoshop CSS has annoyingly put all your images inline with your HTML, meaning it&#8217;s not in a separate stylesheet like it should be.</li>
</ul>
<p>In the <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-4-147/">next step</a> we&#8217;ll discuss how to go from inline XHTML to the two file (.html &#038; .css) standard that will be needed to mark up the design to php.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d146" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+3%29" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+3%29" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+3%29" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing and Coding a Wordpress Theme From Scratch (Part 2)</title>
		<link>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/</link>
		<comments>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 18:05:02 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Photoshop]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[photoshop]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[web dev]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/</guid>
		<description><![CDATA[Going From Photoshop to XHTML to Wordpress Theme.  In this multi-part series I'll detail how to create and design a Wordpress theme in Photoshop and take it from just an idea to fully coded.
]]></description>
			<content:encoded><![CDATA[<p>Designing your first Wordpress theme may seem incredibly ambitious at first but it&#8217;s really not that hard.  It may help your understanding of Wordpress if you find a theme you like and disect or remix it.  This is how I learned to code and one of <a href="http://goscreative.blogspot.com/2008/04/free-wordpress-theme-unstandard-remix.html" target="_blank">my first attempt</a> was a variation of Derek Punsalan&#8217;s theme <a href="http://goscreative.blogspot.com/2008/04/free-wordpress-theme-unstandard-remix.html" target="_blank">The Unstandard</a>.In <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/" target="_blank">Part 1</a> I talked a bit about the tools you&#8217;ll need and how to get prepared.  Now that you&#8217;ve done that we&#8217;re going to get started.</p>
<p><b>Layout and Structure</b></p>
<p><a href="http://www.37signals.com/papers/introtopatterns/" target="_blank">This post</a> by 37 Signals is an incredibly detailed account of how to organize information and using sketches to design for the web. I highly recommend taking a break to read it. As mentioned in the post sketching out the general layout of your site will help you.  For my design I started with this sketch:</p>
<p><span id="more-144"></span></p>
<p><img src="http://farm3.static.flickr.com/2073/2448707505_f104ebe039.jpg" alt="sketching a website"></p>
<p>Let&#8217;s compare the sketch to the finished theme:</p>
<p><a href='http://www.developertutorials.com/blog/wp-content/uploads/2008/04/picture-1.png'><img src="http://farm3.static.flickr.com/2001/2449394258_676eb5ea2b.jpg" alt="sketch to code" class="alignnone size-medium wp-image-145" /></a></p>
<p>As you can see my marked up design remains fundamentally similar to the original concept sketch.</p>
<p><b>Designing WordPress Themes in Photoshop</b></p>
<p>We&#8217;ve got our sketch, lets open up Photoshop and start designing.  Since every design is different, I won&#8217;t bother explaining every single choice I made, instead I&#8217;m going to give you some tips on laying out your design so that it can be successfully marked up for the web.  </p>
<ol>
<li>1. <strong>Work to a grid.</strong> I don&#8217;t necessarily mean the grid that you get when you type <strong>Command+&#8217;</strong> but rather working to a structurally sound grid that corresponds to the <a href="http://www.sitepoint.com/article/principles-beautiful-web-design/3" target="_blank">golden ratio</a> or <a href="http://joshuaclanton.com/blog/2008/01/18/one-third-to-rule-them-all-applying-the-rule-of-thirds-to-web-design/" target="_blank">the rule of thirds</a>. This is because Photoshop has to &#8217;slice&#8217; your resulting design into rectangles and if you keep it in mind while you design, that can be done easily at the end.</li>
<p>In the above picture you can see that I worked to a grid that I created using guides.  As my design progressed, the grid got incredibly convoluted but these lines correspond in some way to the layout and skeleton of the site.  I&#8217;d say this is even more important for minimal designs like my own.</p>
<p><img src="http://farm3.static.flickr.com/2260/2449595376_d365e77b2f.jpg" alt="rule of thirds web design"></p>
<li>2.  <strong>The fewer the slices the better.</strong> So when you finish your design you&#8217;ll slice it into sectors that will then be marked up to xhtml and subsequently php to create your theme.  This the last thing you want is a 100 different areas to code separately. If you study the image below you&#8217;ll see that I had about 16 &#8217;sliced areas&#8217;.
<p><img src="http://farm4.static.flickr.com/3100/2449595324_214a605a44.jpg" alt="slice to xhtml wordpress"></p>
<p>Try not to have more than 20.  Why?  Because each of these slices are images that have to be downloaded and displayed when someone visits your website.  The more images, the slower the load time will be for people with slower connections.  Although in <a href="http://www.developertutorials.com/blog/javascript/designing-and-coding-a-wordpress-theme-from-scratch-part-5-149/">Part 5</a> I&#8217;ll show you how to optimize your image based website for speed, it&#8217;s better practice to have fewer slices.</li>
<li><strong>3. Make each content area it&#8217;s own slice.</strong> I can&#8217;t stress how important this is!  For someone new to XHTML it can be incredibly hard to figure out how to float &lt; div &gt; tags so that content areas remain separate.  The laymans solution?  Don&#8217;t bother!  If all your content is contained in &lt; div &gt; &#8217;s for a specific image or &#8217;slice&#8217; you won&#8217;t have to.
<p>Another reason to do this is that if you have a content area that is divided into slices that cut up the content space, you&#8217;re going to have a much harder time trying to make the content display correctly over two background images.
</li>
<li><strong>4. Work in color proof mode.</strong> When I&#8217;m designing for the web I&#8217;ve learned to work entirely, start to finish, in color proof mode (<strong>command+Y for Mac / control+y for Pc</strong>).  This is because colors in Photoshop can be deceiving and if you aren&#8217;t using websafe colors, you need to make sure everything translates as you want it to.  I explained this in more detail in a previous <a href="http://www.developertutorials.com/blog/design/photoshop-design/color-proofing-photoshop-120/" title="color photoshop proof" target="_blank">article here</a>.</li>
<li><strong>5. Think in 3D.</strong>Your design should not be thought of as a flat surface.  It has depth and the things that are different elevations should be treated the same.  For instance, if you have text or images ontop of content areas in your design, you may want to call on them in the stylesheet instead of leaving &#8216;flat&#8217; as part of the background images.  Thus all stylized text like your header text or social bookmarking links should be images that are displayed with CSS.  This is the second and topmost layer of your design with the layout existing <i>below</i></li>
</ol>
<p>Got all that?  Let&#8217;s move on to <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-3-146/">Part 3 - Photoshop to XHTML in 24 Hours!</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d144" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+2%29" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+2%29" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+2%29" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing and Coding a Wordpress Theme From Scratch (Part 1)</title>
		<link>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/</link>
		<comments>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 18:04:35 +0000</pubDate>
		<dc:creator>JonGos</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Photoshop]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[photoshop]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[tips]]></category>

		<category><![CDATA[tutorials]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/</guid>
		<description><![CDATA[Going From Photoshop to XHTML to Wordpress Theme.  In this multi-part series I'll detail how to create and design a Wordpress theme in Photoshop and take it from just an idea to fully coded.
]]></description>
			<content:encoded><![CDATA[<p>In this multi-part series I&#8217;ll detail how to create and design a Wordpress theme from nothing more than your imagination using Photoshop, CSS, XHTML and PHP.  Before you continue you should look over other tutorials <a href="http://www.developertutorials.com/blog/design/working-with-wordpress-offline-like-a-pro-112/">&#8220;Working with Wordpress Offline Like A Pro</a> and <a href="http://www.developertutorials.com/blog/design/photoshop-design/color-proofing-photoshop-120/">&#8220;Color Proofing Photoshop&#8221;</a> as some of the topics discussed there will come up in this tutorial like working offline to develop themes, and proofing your colors so that they translate accurately for the web. At the end of the entire series I&#8217;ll allow you to download the fully developed theme with the PSD, and theme-files including stylesheets, and javascript.</p>
<p><span id="more-143"></span></p>
<p><b>Tools for the Task</b></p>
<p>For clarification, here are all the tools I used in the making of this theme:</p>
<ul>
<li>A text editor like <a href="http://www.jedit.org/" target="_blank">jEdit</a> for hardcoding</li>
<li><a href="http://adobe.com" target="_blank">Photoshop CS3</a></li>
<li><a href="http://wordpress.org" target="_blank">Wordpress 2.5</a></li>
<li><a href="http://www.mamp.info/" target="_blank">MAMP</a></li>
<li><a href="http://www.colorschemer.com/" target="_blank">Color Schemer Studio</a></li>
<li><a href="http://mozilla.org" target="_blank">Firefox + <a href="https://addons.mozilla.org/en-US/firefox/addon/60" target="_blank">Web Developer Extension</a> (for Local Validation)</li>
<li><a href="http://ipinfo.info/netrenderer/" target="_blank">NetRenderer</a> (to <a href="http://goscreative.blogspot.com/2007/07/tip-website-validation.html" target="_blank">see how your theme looks across browsers</a>)</li>
</ul>
<p>You don&#8217;t have to use the same tools, those are just the ones I use in my workflow.</p>
<p><b>Preparation</b></p>
<p>It&#8217;s important to remember these three things as well:</p>
<ol>
<li><strong>Take your time.</strong>  If this is your first attempt at a wordpress theme, you&#8217;ll make a lot of mistakes.  Just learn from them, the first time is never the best.</li>
<li><strong>Use <a href="http://www.w3schools.com/" target="_blank">W3schools.com</a> religiously!</strong> Why do people validate code, to maximize the exposure of their work.  Learning to validate as you go will improve the quality of the work you produce and eventually make you faster.</li>
<li><strong>Ask a lot of questions.</strong>  If you get stuck please feel free to come back to this column and post questions as comments.  Alternatively you can e-mail me at <strong>jongos [at] gmail</strong> to seek out additional advice but since I like to make information public, if you email me privately your questions may be posted here to help others.</li>
</div>
<p>The End Result:</p>
<p><img src="http://farm3.static.flickr.com/2001/2449394258_676eb5ea2b.jpg"></p>
<p>Like what you see?  Without further adieu <a href="http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-2-144/">let&#8217;s get started</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d143" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+1%29" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+1%29" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/&amp;title=Designing+and+Coding+a+Wordpress+Theme+From+Scratch+%28Part+1%29" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/design/designing-and-coding-a-wordpress-theme-from-scratch-part-1-143/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What&#8217;s the deal with open source licenses?</title>
		<link>http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/</link>
		<comments>http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 08:44:24 +0000</pubDate>
		<dc:creator>Akash Mehta</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[legal]]></category>

		<guid isPermaLink="false">http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/</guid>
		<description><![CDATA[So, you&#8217;re a decent web developer. You&#8217;ve written some nifty code, and now you want to share it with the world. But wait - what about licensing? Here&#8217;s a brief run down on what you need to know about open source licenses.

Disclaimer: Akash isn&#8217;t really a lawyer, and he&#8217;s certainly not your lawyer. None of [...]]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;re a decent web developer. You&#8217;ve written some nifty code, and now you want to share it with the world. But wait - what about licensing? Here&#8217;s a brief run down on what you need to know about open source licenses.</p>
<p><span id="more-73"></span></p>
<p><em>Disclaimer: Akash isn&#8217;t really a lawyer, and he&#8217;s certainly not your lawyer. None of this should be taken as legal advice; always research licenses and legalities before consenting to them. If in doubt, seek legal advice or try the <a href="http://www.softwarefreedom.org/" target="_blank">Software Freedom Law Center</a>.</em></p>
<p>When it comes to the legalities of open source licensing, there are arguments for all the different options - <a href="http://www.opensource.org/licenses/alphabetical" target="_blank">and there are hundreds</a>. For open source PHP code, the most popular license is the GPL, however most major projects write their own license to suit their intentions. While this is a little over the top for just releasing a few snippets of code, or maybe a small application, it&#8217;s worth noting that not all licenses suit everyone, and it&#8217;s important to be aware of what releasing your code under a particular license means for you.</p>
<p>There are four main issues with open source licenses:</p>
<ul>
<li>Commercial / proprietary use of the code / software</li>
<li>Obligation to release modifications to the code back to the community</li>
<li>Obligation to make the code available to downstream users</li>
<li>Revocability of the license at your discretion</li>
</ul>
<p>You will have to consider your target audience and how flexible you want to be when deciding. For example, many die-hard open source fans balk at the mere idea of allowing a commercial entity to use their code. I recently contributed some code to a particular open source project, and was discussing licenses over MSN. When suggesting that &#8220;I wanted a particular company to use my code&#8221;, they quickly replied, &#8220;[this] is not the project for you.&#8221;.</p>
<p>You may not be terribly interested in licensing issues; in fact, have a read through <a href="http://en.wikipedia.org/wiki/Beerware" target="_blank">the Wikipedia article on Beerware</a> - it may be the best option for you.</p>
<p>If you want to know what&#8217;s going on with your code, consider using the GPL. With GPL licensed code, any modifications must be made available to the general community, and users of derivatives of your code must have access to the code. However, be aware that this could cause serious problems when working with other code licensed under a different license. In general, GPL code works best when used with other GPL code.</p>
<p>If you want to be a bit more lenient, try the BSD license, which permits proprietary use of your code. There&#8217;s also the MIT license - <a href="http://www.opensource.org/licenses/mit-license.php" target="_blank">have a read through it</a> - which basically gives your end users a lot of flexibility while protecting your liabilities.</p>
<p>Revocability is the final key issue. For example, take Trellis Desk, a product recently reviewed here on the DT blog as a &#8220;promising open source project&#8221;. ACCORD5, which develops Trellis Desk, essentially makes the code available. And that&#8217;s about it. By definition it isn&#8217;t actually open source; <a href="http://www.accord5.com/trellis/download" target="_blank" rel="external nofollow">have a read through the license</a>. They reserve the right to revoce your license to use the software at any time, and if they so desire, they can send you a notice within 48 hours of which you have to &#8220;destroy all copies of the software&#8221;. Open source inasfar as they provide the source code, but there&#8217;s no way they&#8217;d get that past the <a href="http://www.opensource.org/" target="_blank">Open Source Initiative</a>, which <a href="http://www.opensource.org/approval" target="_blank">decides if a license is actually open source</a>.</p>
<p>In general, if you must you can revoke a license, even if you don&#8217;t explicitly declare so in the license terms (unless, of course, you explicitly declare otherwise in the license terms) - although this can change based on geographic laws as well, e.g. a license in the United States may not hold up in Czech Republic.</p>
<p>A mature, well-written open source license will help you take care of legalities quickly and get on with writing code. My advice: pick one and stick with it. If in doubt, use the GPL; if you want to get your code out to more people, try BSD. If you really don&#8217;t care, go for Beerware, and if you want maximum flexibility, <a href="http://creativecommons.org/licenses/publicdomain/" target="_blank">there&#8217;s always public domain</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark" style="float:left;">
<div class="d73" style="overflow:hidden">
<div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/&amp;title=What%26%238217%3Bs+the+deal+with+open+source+licenses%3F" title="Add to&nbsp;Del.icio.us">Del.icio.us</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/&amp;title=What%26%238217%3Bs+the+deal+with+open+source+licenses%3F" title="Add to&nbsp;Digg This">Digg This</a></div><div id="socialstyles"><a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/&amp;title=What%26%238217%3Bs+the+deal+with+open+source+licenses%3F" title="Add to&nbsp;Stumble">Stumble</a></div></div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.developertutorials.com/blog/web/whats-the-deal-with-open-source-licenses-73/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
