<?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>Webdevtuts &#187; part 3</title>
	<atom:link href="http://www.webdevtuts.net/tag/part-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevtuts.net</link>
	<description>Making tutorials fun and easy!</description>
	<lastBuildDate>Mon, 06 Sep 2010 17:54:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PSD to WordPress Series Part 3: Final Tutorial</title>
		<link>http://www.webdevtuts.net/wordpress/psd-to-wordpress-series-part-3-final-tutorial/</link>
		<comments>http://www.webdevtuts.net/wordpress/psd-to-wordpress-series-part-3-final-tutorial/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 22:19:57 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[part 3]]></category>
		<category><![CDATA[PSD]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=635</guid>
		<description><![CDATA[I know there are many developers and normal people who want to know how to design a wordpress theme from scratch. Well today is your lucky day. In this series, PSD to Wordpress we will design a Mockup in Photoshop, then code it for wordpress.(part3)]]></description>
			<content:encoded><![CDATA[<p><!--adsensestart--></p>
<p>Ok Were finally on the last step on how to transform a photoshop mockup into a working wordpress theme. For this tutorial you will need</p>
<p>1.<a href="http://elliotjaystocks.com/blog/free-starkers-wordpress-theme/"><strong>Stalker Naked WordPress theme!</strong>-By Elliot Jay Stocks </a><br />
2. Local Server to run wordpress <a href="http://www.apachefriends.org/en/xampp.html"><strong>xxamp</strong></a><br />
3. The html file from<a href="http://www.webdevtuts.net/wordpress/psd-to-wordpress-series-part-2/"><strong>PSD to wordpress part 2</strong></a></p>
<p>Ok so now we will begin the final part to PSD to WordPress series. You should now have the stalkers wordpress downloaded and ready to use. Also before we begin make sure you have xxamp or a local server up and running so you can see changes we make to our wordpress theme.</p>
<p>Open up your primary code editor. I will used dreamweaver for this tutorial. If you do not have dreamweaver then you can download the free trial or use a free code editor like<br />
<a href="http://download.cnet.com/Notepad/3000-2352_4-10327521.html">notepad++</a> for windows and for <a href="http://www.activestate.com/komodo_edit/downloads/">Komondo</a> for mac</p>
<p>Now inside the stalker folder you should have 15 PHP files but we will only use 7 of them. The reason we will only use 7 because most of the steps we will cover today can be used on other pages. So after this tutorial you should have and idea or clear vision on what to do for the other wordpress pages.</p>
<p><strong>Note:</strong> You do not have to delete the ones we do not use</p>
<p>The files we will use/need for this tutorial are</p>
<ul>
<li>archive.php</li>
<li>footer.php</li>
<li>header.php</li>
<li>index.php</li>
<li>page.php</li>
<li>sidebar.php</li>
<li>single.php</li>
</ul>
<p><strong>archive.php</strong> &#8211; The page that shows after you&#8217;ve click on a category name<br />
<strong>header.php</strong> &#8211; for all JavaScript or Stylesheet imports<br />
<strong>index.php</strong> Main/Home page<br />
<strong>page.php</strong> Single page<br />
<strong>sidebar.php</strong> sidebar<br />
<strong>single.php</strong> after you click on a post its takes you to the single.php page</p>
<p>Since we&#8217;ve already coded the theme into xhtml/css we will just be copying and pasting a lot of things and changing some of our HTML markup into php functions.</p>
<h2>Step 1</h2>
<p>First thing is first. copy your entire <strong>style.css</strong> to your wordpress style.css</p>
<p><strong>Note:</strong> Copy everything after <strong>Code start</strong>. Everything above that is the css reset and has to go into another style sheet<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/1.copystyle.jpg" alt="copy style" /></p>
<h2>Step 2</h2>
<p>Now lets place the css reset code into the right file. Click on the <strong>Style&gt;&gt;Css&gt;&gt;Reset</strong>.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/2.stylefolder.jpg" alt="delete reset wordpress" /></p>
<p>Delete everything in the reset file.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/3.resetcodeb4.jpg" alt="reset before" /></p>
<p>Now copy everything above <strong>code starts</strong> and place it into the wordpress reset file then save it.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/3.resetcodeafter.jpg" alt="reset after" /></p>
<p>You should have something like this so far<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/preview.jpg" alt="preview" /></p>
<h2>Step 3</h2>
<p>Now that our css and reset files is taken care of its time to get the ball rolling and get our wordpress theme looking good. Open up your index.html file <em>(From part2 psd wordpress series)</em> and <strong>header.php</strong> file. Copy the highlighted code into your header.php file.</p>
<p><img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/copyheader.jpg" alt="copy code" /></p>
<pre>
<code>&lt;div id=&quot;header&quot;&gt;

&lt;div id=&quot;main_nav&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.webdevtuts.net&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;?php wp_list_categories('title_li='); ?&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!--end main_nav--&gt;

&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;

&lt;div id=&quot;logo&quot;&gt;&lt;/div&gt;&lt;!--end logo--&gt;

&lt;/div&gt;&lt;!--end header--&gt;

&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;

&lt;div id=&quot;Container&quot;&gt;<!--formatted--></code>
</pre>
<h2>Step 4</h2>
<p>Now open your <strong>index.php</strong> file.</p>
<p>First thing you should do is add</p>
<div id="main_col">right below the header tag then close it right above the sidebar tag.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/wrapmaincol.jpg" alt="add wrap" /></p>
<p>This code below is our post section. We will substitute some XHTML markup into wordpress php functions</p>
<p><strong>Below is the entire section for the post area (Just the normal HTML)</strong><br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/normalhtml.jpg" alt="normal html" /></p>
<p><strong>Below is the wordpress markup that we will be using</strong><br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/wordpresshtml.jpg" alt="Wordpress html" /></p>
<p>Copy the code below into your index.php</p>
<pre>
<code>&lt;div class=&quot;post_break&quot;&gt;
&lt;div id=&quot;post_thumb&quot;&gt;&lt;img src=&quot;&lt;?php echo get_post_meta($post-&gt;ID, 'Thumbnail',true) ?&gt;&quot; alt=&quot;Post Image&quot; id=&quot;postbreakimg&quot; /&gt;&lt;/div&gt;
&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div id=&quot;post_info&quot;&gt;&lt;p&gt;Posted in &lt;?php the_category(', ') ?&gt; &lt;?php the_time('F jS, Y') ?&gt; by &lt;?php the_author_posts_link(); ?&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div id=&quot;post_text&quot;&gt;&lt;?php the_excerpt('Read the rest of this entry &amp;raquo;'); ?&gt;&lt;/div&gt;
&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot; class=&quot;post_more&quot;&gt;Read More&lt;/a&gt;
&lt;/div&gt;&lt;!--end post break--&gt;

&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;<!--formatted--></code>
</pre>
<p><strong>Note:</strong> Below is information to help you better understand what I did and what changes I made.</p>
<p>So I will start off with the <strong>div class=&#8221;Post_break&#8221;</strong>. I used <strong>div class</strong> because there are mutiple post, and when you have mutiple things using the same styling then it is good to use class<br />
instead of <strong><br />
</strong></p>
<p><strong> </strong> plus it will keep your code vaild.</p>
<p>For the image I kept the <strong>div id=&#8221;post_thumb</strong> but I changed the inside to</p>
<pre><code>&lt;img src=&quot;&lt;?php echo get_post_meta($post-&gt;ID, 'Thumbnail',true) ?&gt;&quot; alt=&quot;Post Image&quot; id=&quot;postbreakimg&quot; /&gt;<!--formatted--></code></pre>
<p>The code above tells wordpress to grab the thumbnail image. Whenever you would create a new post you would insert the word Thumbnail into your custom fields and link to the direct image and there is where your image will appear.</p>
<p>For the second level heading(H2) I change the inside of the h2 tags to</p>
<pre><code>&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;<!--formatted--></code>
</pre>
<p>For the post info section I changed the inside of the div to</p>
<pre><code>&lt;p&gt;Posted in &lt;?php the_category(', ') ?&gt; &lt;?php the_time('F jS, Y') ?&gt; by &lt;?php the_author_posts_link(); ?&gt;&lt;/p&gt;<!--formatted--></code></pre>
<p>The code above basically tells wordpress to find out what category the post was written for then the date of publish and finally the author name that has written that post.</p>
<p>For <strong>div id=&#8221;post_text&#8221;</strong> I&#8217;ve added</p>
<pre><code>&lt;?php the_excerpt('Read the rest of this entry &amp;raquo;'); ?&gt;<!--formatted--></code>
</pre>
<p>which tells wordpress to get the short description of the post instead of the entire post</p>
<p>For the read more link I&#8217;ve added</p>
<pre>
<code>&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot; class=&quot;post_more&quot;&gt;Read More&lt;/a&gt;<!--formatted--></code>
</pre>
<p>which tells wordpress that you would like to read more and it will take you to the single page.</p>
<p>Finally I ended the post section then cleared the floats.</p>
<p>The index.php page is finally completed in here is what your page should like.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/preview2.jpg" alt="preview 2" /></p>
<h2>Step 5</h2>
<p>Now that our <strong>header.php, index.php</strong> are completed we will now work on our <strong>sidebar.php</strong> page. Open your sidebar.php page.</p>
<p><strong>Note:</strong> remember that most of the divs and markup codes are codes/tags I grab are from the original <strong>index.html</strong> file</p>
<p>Scroll down the index.html page until you see the sidebar tag. Copy <strong>div id=&#8221;sidebar&#8221;</strong> into your <strong>sidebar.php</strong> file. Add the code right below the php header tag<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/sidebar5.jpg" alt="sidebar example" /></p>
<p>Now lets add our advertisement 125&#215;125 into our wordpress layout.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/sidebarhelp.jpg" alt="sidebar layout" /></p>
<p><strong>Copy the code below</strong></p>
<pre>
<code>&lt;h2&gt;Sponsors&lt;/h2&gt;
&lt;ul id=&quot;adverts&quot;&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/ad125.jpg&quot; alt=&quot;125x125 banner ad&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/ad125.jpg&quot; alt=&quot;125x125 banner ad&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/ad125.jpg&quot; alt=&quot;125x125 banner ad&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/ad125.jpg&quot; alt=&quot;125x125 banner ad&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;!--adverts--&gt;

&lt;a class=&quot;side_more&quot; href=&quot;&quot;&gt;Advertise here&lt;/a&gt;

&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;<!--formatted--></code>
</pre>
<p><strong>Note:</strong> Below is information to help you better understand what I did and what changes I made.</p>
<p>In the normal HTML I just linked the images to the image folder but with wordpress you have to use a custom php function which calls the images.</p>
<p>Now lets add the Flickr images to our theme. Copy the code below</p>
<pre>
<code>&lt;h2&gt;Flickr&lt;/h2&gt;
&lt;ul id=&quot;flickr&quot;&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/flk_samp.jpg&quot; alt=&quot;flickr&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;!--end flickr--&gt;<!--formatted--></code>
</pre>
<p>The code above does the same thing as the ads. WordPress calls for the images. If you wanted to turn these images into live working images from your flickr account then the best thing to do is use a wordpress plugin.</p>
<p>You should now have something like this<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/preview3.jpg" alt="preview3" /></p>
<h2>Step 6</h2>
<p>Now that are <strong>header.php, index.php,</strong> and <strong>sidebar.php</strong> are completed it is time to complete our single.php page. The single.php is very simple to complete.</p>
<p>All we have to do is add the main col tag after the header tag(Very first tag at the top) then delete this tag</p>
<pre>
<code>&lt;?php previous_post_link('&amp;laquo; %link') ?&gt; | &lt;?php next_post_link('%link &amp;raquo;') ?&gt;<!--formatted--></code>
</pre>
<p><img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/step6topcode.jpg" alt="Code explanation" /></p>
<p>Finally lets add this code after the end tag of main col<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/step6btmcode.jpg" alt="bottom code" /></p>
<pre>
<code>&lt;?php get_sidebar(); ?&gt;<!--formatted--></code>
</pre>
<p>Your single page should now look like this<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/preview4.jpg" alt="preview 4" /></p>
<h2>Step 7</h2>
<p>Open your <strong>archive.php</strong>. For our archive page we will just be adding the main col tags and using the post code from index.php. Hope that made sense!<br />
Below is the archive page <strong>untouched!</strong><br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/archiveb4.jpg" alt="archive" /></p>
<p>Add the <strong>div id=&#8221;main_col&#8221;</strong> to the top of your <strong>archive.php</strong> page and place it right under the get header function. Then replace the post area code<br />
with the post area code from your <strong>index.php</strong> file. Do not forget to close the main col div.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/archivephptop.jpg" alt="Archive Top" /></p>
<p>Here is an example of what your <strong>archive.php</strong> should actually look like.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/archive-example.jpg" alt="archive example" /></p>
<h2>step 8</h2>
<p>Now we will work on the footer page Open your footer.php and copy the footer tag from the <strong>index.html</strong> into your footer.<br />
<img src="http://webdevtuts.net/wp-content/uploads/2009/09/part3/setp8footer.jpg" alt="footer tag" /></p>
<p>CONGRATULATION! You are now finish and should have your first wordpress theme completed. I did not go over some of the pages because what you&#8217;ve learn from this tutorial can be applied to other pages in wordpress. If you would like for me to create a screencast for part 3 please leave a comment letting me know and will create a screen cast for part 3. Hard work was put into this series and I truly hope it helped you beginners out there understand wordpress better. I did not go over the <strong>comment.php</strong> page but you can check this <a href="http://www.darrenhoyt.com/2007/08/18/styling-your-wordpress-comments/">article</a> from Darren Hoyt and it will teach you all about the comment.php page. Thanks for following this tutorial, if you have any question leave a comment and I will respond asap.</p>
<p><a title="Downloaded {title} times" href="http://www.webdevtuts.net/wp-content/uploads/2009/07/downloads/PSD TO WORDPRESS-Theme.rar"><img src="http://webdevtuts.net/wp-content/uploads/2009/post/download_btn.gif" alt="Download" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/wordpress/psd-to-wordpress-series-part-3-final-tutorial/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
