<?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>MikeJandreau &#187; creating</title>
	<atom:link href="http://www.mikejandreau.com/tag/creating/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikejandreau.com</link>
	<description>Designer. Writer. Musician. Movie Snob.</description>
	<lastBuildDate>Mon, 23 Jan 2012 01:42:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Creating WordPress Themes</title>
		<link>http://www.mikejandreau.com/creating-wordpress-themes/</link>
		<comments>http://www.mikejandreau.com/creating-wordpress-themes/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 15:47:52 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[creating]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://mikejandreau.com/creating-wordpress-themes/</guid>
		<description><![CDATA[Don&#8217;t get me wrong, creating WordPress themes is not for the faint of heart, nor for the casual blogger who doesn&#8217;t really have a good grasp on developing websites. However, if you know your way around PHP and basic HTML, you should have no issues creating your own theme, or adapting a website into a [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t get me wrong, creating WordPress themes is not for the faint of heart, nor for the casual blogger who doesn&#8217;t really have a good grasp on developing websites.  However, if you know your way around PHP and basic HTML, you should have no issues creating your own theme, or adapting a website into a WordPress theme.</p>
<p>Generally, themes go into the same location, regardless of your blog structure; /wp-content/themes.  It depends on what your theme name is, as to what folder you put it in.  However, each theme has its own folder, to be kept separate.</p>
<p>When you first install WordPress, you&#8217;ll get the &#8220;default&#8221; theme, which is a great place to start.  Usually I copy that folder down to my desktop, and make a clone of it, to work off of.</p>
<p>A theme needs to consist of a few basic files, to make it work:</p>
<ul>
<li>index.php</li>
<li>style.css</li>
<li>comments.php</li>
</ul>
<p>You can take it a step further, if you want to easily update/change aspects of the design, and add in a header.php and footer.php.  For this example, we&#8217;ll use header and footer.</p>
<p>At the top of any existing theme&#8217;s CSS file (or when creating a new file), you need to always ensure that you&#8217;ve got some information to let WordPress know what the theme is.  It&#8217;ll generally look like this:</p>
<blockquote><p>/*<br />
Theme Name: What do you want to call your theme in WordPress?<br />
Theme URI: Where you downloaded the theme from<br />
Description: any details?<br />
Author: your name<br />
Author URI: your URI<br />
Version: You don&#8217;t need a version, but can put one in here if you want to.</p>
<p>General comments/License Statement if any.<br />
.<br />
*/</p></blockquote>
<p>This will tell WordPress information about your theme, to display under the &#8220;Presentation&#8221; tab.</p>
<p>So, you now have your theme set up, but need the files. Why? Simple, to make the theme work.  Here&#8217;s a quick run down of what each file does.</p>
<ul>
<li> index.php &#8211; this is the homepage of your WordPress.  You can get away with <em>only</em> having an index, if you don&#8217;t want to create different pages for each place in your installation.</li>
<li>style.css &#8211; the stylesheet for your design. You should be fairly comfortable with CSS by this point, if not, there&#8217;s a ton of resources available on the internet.</li>
<li>comments.php &#8211; this is the template for what your comments page/form will look like.  If you don&#8217;t have one, no one will be able to comment on your WordPress</li>
<li>header.php &#8211; this file can be included at the top of all of your &#8220;pages&#8221; and &#8220;posts,&#8221; so that you can easily change something across all the pages, without editing each one.  This is where you include the majority of your design.</li>
<li>footer.php &#8211; same as the header.php, but goes after your content, instead of before.  This is where you conclude your design that comes after the &#8220;content&#8221; or &#8220;body&#8221; of your site.</li>
</ul>
<p>Generally, there are a bunch of other files you can include, too; 404.php, single.php, page.php, author.php, archive.php, search.php, etc.</p>
<p>Each page serves a separate purpose. I won&#8217;t get into too much detail, as to not confuse you.  Here&#8217;s a quick example of what an index.php might look like, if you made it yourself:</p>
<blockquote><p> &lt;?php get_header(); ?&gt;</p>
<p>&lt;?php if (have_posts()) : ?&gt;</p>
<p>&lt;?php while (have_posts()) : the_post(); ?&gt;</p>
<p>&lt;div class=&#8221;post&#8221; id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221;&gt;<br />
&lt;?php the_content(&#8216;&lt;br /&gt;&lt;br /&gt;&lt;div align=&#8221;right&#8221;&gt;Continue Reading &lt;?php the_title(); ?&gt;  »&lt;/div&gt;&#8217;); ?&gt;&lt;/span&gt;&lt;div align=&#8221;right&#8221;&gt;&lt;br /&gt;&lt;br /&gt;Posted by: &lt;a href=&#8221;&lt;?php the_author_url(); ?&gt;&#8221;&gt;&lt;?php the_author(); ?&gt;&lt;/a&gt; on &lt;?php the_time(&#8216;F jS, Y&#8217;) ?&gt; at &lt;?php the_time() ?&gt;&lt;br&gt;&lt;span class=&#8221;postmetadata&#8221;&gt;Posted in &lt;?php the_category(&#8216;, &#8216;) ?&gt; | &lt;?php edit_post_link(&#8216;Edit&#8217;, &#8221;, &#8216; | &#8216;); ?&gt;  &lt;?php comments_popup_link(&#8216;Leave a Comment  »&#8217;, &#8217;1 Comment  »&#8217;, &#8216;% Comments  »&#8217;); ?&gt;&lt;/span&gt;&lt;/td&gt;</p>
<p>&lt;?php else : ?&gt;</p>
<p>&lt;h2 class=&#8221;center&#8221;&gt;Not Found&lt;/h2&gt;<br />
&lt;p class=&#8221;center&#8221;&gt;Sorry, but you are looking for something that isn&#8217;t here.&lt;/p&gt;<br />
&lt;?php include (TEMPLATEPATH . &#8220;/searchform.php&#8221;); ?&gt;</p>
<p>&lt;?php endif; ?&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;?php get_sidebar(); ?&gt;</p>
<p>&lt;?php get_footer(); ?&gt;</p></blockquote>
<p>So, what does all that do?  Pretty simple, I&#8217;ll break it down bit by bit:</p>
<p>&lt;?php get_header(); ?&gt; &#8211; this bit simple calls my header.php file to be included.<br />
&lt;?php if (have_posts()) : ?&gt; &#8211; this is very important, your theme won&#8217;t work without it.  It simple tells WordPress if you have posts, to do the following.<br />
&lt;?php while (have_posts()) : the_post(); ?&gt; &#8211; if you have posts, show them on this page.</p>
<p>This next bit&#8217;s a bit more complicated, because there&#8217;s a lot of parts to it:<br />
&lt;?php the_content(&#8216;&lt;br&gt;&lt;br&gt;&lt;div align=&#8221;right&#8221;&gt;Continue Reading &lt;?php the_title(); ?&gt;  »&lt;/div&gt;&#8217;); ?&gt; &#8211; php the_content is what shows your post. The &#8220;continue reading part&#8221; will get shown if your post contains a &#8220;More&#8221; link in it.  I&#8217;ve set this particular one up to show &#8220;Continue Reading This Post&#8221;, where &#8220;This Post&#8221; would be replaced by whatever I&#8217;m calling the post in WordPress.</p>
<p>Posted by: &lt;a href=&#8221;&lt;?php the_author_url(); ?&gt;&#8221;&gt;&lt;?php the_author(); ?&gt;&lt;/a&gt; on &lt;?php the_time(&#8216;F jS, Y&#8217;) ?&gt; at &lt;?php the_time() ?&gt;&lt;br&gt;&lt;span class=&#8221;postmetadata&#8221;&gt;Posted in &lt;?php the_category(&#8216;, &#8216;) ?&gt; | &lt;?php edit_post_link(&#8216;Edit&#8217;, &#8221;, &#8216; | &#8216;); ?&gt;  &lt;?php comments_popup_link(&#8216;Leave a Comment  »&#8217;, &#8217;1 Comment  »&#8217;, &#8216;% Comments  »&#8217;); ?&gt; &#8211; This will simply show: Posted by: Mike (as a link to my author page) on 10/19/2007 at 12:01PM.  Posted in Design, WordPress Tutorials, WordPress.  Leave a Comment (or if there&#8217;s comments, it&#8217;ll show the number of comments already left.)</p>
<p>This bit: &lt;?php edit_post_link(&#8216;Edit&#8217;, &#8221;, &#8216; | &#8216;); ?&gt; can be a bit confusing.  What this does is simply show you a link that says &#8220;Edit&#8221; when you&#8217;re viewing your post, and you&#8217;re an admin on the blog.  Other people won&#8217;t see it though, don&#8217;t worry.</p>
<p>&lt;?php else : ?&gt; &#8211; Very important to have, this closes the previous bit where we tell WordPress what to do if we have posts.</p>
<p>&lt;h2 class=&#8221;center&#8221;&gt;Not Found&lt;/h2&gt;<br />
&lt;p class=&#8221;center&#8221;&gt;Sorry, but you are looking for something that isn&#8217;t here.&lt;/p&gt;<br />
&lt;?php include (TEMPLATEPATH . &#8220;/searchform.php&#8221;); ?&gt;</p>
<p>Above is a simple include to a search form.  In case someone tries to access a URL that doesn&#8217;t exist.</p>
<p>&lt;?php get_sidebar(); ?&gt; &#8211; includes a sidebar, if you&#8217;ve got one.</p>
<p>&lt;?php get_footer(); ?&gt; &#8211; includes your footer.</p>
<p>It seems a lot more complicated than it is, and there&#8217;s an infinite amount of variables, and things you can do with your theme.  I&#8217;ll cover some more variables next time, and what they do.  Hope this helped get you started.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikejandreau.com/creating-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

