<?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>My Wordpress Dev &#187; Wordpress</title>
	<atom:link href="http://wp.mahesha.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.mahesha.com</link>
	<description>My Wordpress development notes</description>
	<lastBuildDate>Thu, 29 Oct 2009 06:21:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-rare</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Myth &#8211; as in &#8216;My Theme&#8217; : step 1</title>
		<link>http://wp.mahesha.com/2009/10/28/myth-as-in-my-theme-step-1/</link>
		<comments>http://wp.mahesha.com/2009/10/28/myth-as-in-my-theme-step-1/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 01:52:54 +0000</pubDate>
		<dc:creator>Mahesh Asolkar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Myth Theme]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://wp.mahesha.com/?p=4</guid>
		<description><![CDATA[This is by no means a tutorial. Just my notes while I try to write a Wordpress theme. There are umpteen themes available out there, so why write one of your own? Strictly educational&#8230;
The theme (also used in this blog) is still in the making. That probably explains the ugly look of the site. Hopefully [...]]]></description>
			<content:encoded><![CDATA[<p>This is by no means a tutorial. Just my notes while I try to write a Wordpress theme. There are umpteen themes available out there, so why write one of your own? Strictly educational&#8230;</p>
<p>The theme (also used in this blog) is still in the making. That probably explains the ugly look of the site. Hopefully that should change as the theme progresses.</p>
<p><strong>Starting Point</strong></p>
<p>So, I have started with pretty much an empty theme. All it has is a <code>style.css</code> file with following contents:</p>
<pre>/*
Theme Name: Myth - as in 'My Theme'
Theme URI: http://wp.mahesha.com/
Description: A simplistic theme
Version: 1.0
Author: Mahesh Asolkar
Author URI: http://tech.mahesha.com/
Tags: fixed width, widgets
*/  

body {
  font-family : "Georgia", serif;
  font-size : 1.2em;
}</pre>
<p>An <code>index.php</code> file with:</p>
<pre> &lt;?php
/**
 * @package WordPress
 * @subpackage Myth_Theme
 */

get_header(); ?&gt;

&lt;?php get_sidebar('north'); ?&gt;

  &lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot; role=&quot;main&quot;&gt;

  &lt;?php if (have_posts()) : ?&gt;

    &lt;?php while (have_posts()) : the_post(); ?&gt;

      &lt;div &lt;?php post_class() ?&gt; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&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;small&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/small&gt;

        &lt;div class=&quot;entry&quot;&gt;
          &lt;?php the_content('Read the rest of this entry &amp;raquo;'); ?&gt;
        &lt;/div&gt;

        &lt;p class=&quot;postmetadata&quot;&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt;  &lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt;&lt;/p&gt;
      &lt;/div&gt;

    &lt;?php endwhile; ?&gt;

    &lt;div class=&quot;navigation&quot;&gt;
      &lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link('&amp;laquo; Older Entries') ?&gt;&lt;/div&gt;
      &lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link('Newer Entries &amp;raquo;') ?&gt;&lt;/div&gt;
    &lt;/div&gt;

  &lt;?php else : ?&gt;

    &lt;h2 class=&quot;center&quot;&gt;Not Found&lt;/h2&gt;
    &lt;p class=&quot;center&quot;&gt;Sorry, but you are looking for something that isn't here.&lt;/p&gt;
    &lt;?php get_search_form(); ?&gt;

  &lt;?php endif; ?&gt;

  &lt;/div&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>﻿<br />
This is almost a copy of the same file from the default theme that comes with Wordpress. The only change I probably made was move the <code>get_sidebar('north')</code> above the content and specifically called for &#8216;north&#8217; sidebar.  This also means that I have a <code>sidebar-north.php</code> file that has the sidebar implementation. Here&#8217;s the content of that file:</p>
<pre> &lt;?php
# Myth Sidebar
?&gt;
&lt;h1&gt;Activities&lt;/h1&gt;
&lt;ul id=&quot;sidebar_north&quot;&gt;
&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Activities Bar') ) : ?&gt;
  &lt;li id=&quot;about&quot;&gt;
    &lt;h2&gt;About&lt;/h2&gt;
    &lt;p&gt;This is my blog.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li id=&quot;links&quot;&gt;
    &lt;h2&gt;Links&lt;/h2&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;http://wp.mahesha.com&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;?php endif; ?&gt;
&lt;/ul&gt;
 </pre>
<p>Using the <code>dynamic_sidebar('Activities Bar')</code> function sort of widgetizes the theme. You can use the theme preferences in the admin panel to add widgets in the sidebar. This also requires the definition of the &#8216;Activities Bar&#8217; sidebar. This is done in the <code>functions.php</code> file, like so:</p>
<pre>
&lt;?php
automatic_feed_links();

if ( function_exists('register_sidebar') ) {
  register_sidebar(array(
    'name' =&gt; 'Activities Bar',
    'before_widget' =&gt; '&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;',
    'after_widget' =&gt; '&lt;/li&gt;',
    'before_title' =&gt; '&lt;h2 class=&quot;widgettitle&quot;&gt;',
    'after_title' =&gt; '&lt;/h2&gt;',
  ));
}
?&gt; </pre>
<p>So there. That&#8217;s where I am at right now, the starting point.</p>
<p>Wish me luck with this theme. I have no plans on what I want it to look like, function like. I am going to let the beast grow on its own!</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.mahesha.com/2009/10/28/myth-as-in-my-theme-step-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
