<?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>Website Designer Nepal</title>
	<atom:link href="http://abhi.com.np/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://abhi.com.np/blog</link>
	<description>Free Website Design and Web Development Tutorials, Free Source Code Download</description>
	<lastBuildDate>Wed, 03 Mar 2010 13:58:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WP Theme Lesson #16: Comments Template</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-16-comments-template/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-16-comments-template/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 09:59:03 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=673</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. You’re almost done. Hang on for just one more lesson. Today, you take on the life of all blogs; the comments template. In my opinion, a blog is not a blog if it doesn’t allow readers to comment. To some, comments are not important, but it’s [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p><strong>You’re almost done</strong>. Hang on for just <strong>one more lesson</strong>. Today, you take on the life of all blogs; the <strong>comments template</strong>. In my opinion, a blog is not a blog if it doesn’t allow readers to comment. To some, comments are not important, but it’s strange for me to imagine blogs without them.</p>
<p><strong>You should know</strong>:</p>
<ul>
<li>There’s <strong>no right way</strong> to set up the comments template in <strong>comments.php</strong>.</li>
<li>Most WordPress designers <strong>use the default comments template</strong> from the WordPress Default Theme, <strong>Kubrick</strong>.</li>
<li>Some designers modify the default comments template to suit their needs.</li>
<li><strong>You will use my modified version of the default comments template</strong>.</li>
</ul>
<h3>Step 1</h3>
<ul>
<li>Create a new file: <strong>comments.php</strong>.</li>
<li>Copy my <a href="http://www.wpdesigner.com/wp-content/files/wp-tutorial/comments.txt">comments.txt</a> file to your <strong>comments.php</strong>.</li>
<li>Save comments.php.</li>
</ul>
<h3>Step 2</h3>
<ul>
<li>Copy my <a href="http://www.wpdesigner.com/wp-content/files/wp-tutorial/comments-template-css.txt">comments-template-css</a> file to your <strong>style.css</strong>.</li>
<li>Place it at the end of style.css or right above <strong>#footer</strong>.</li>
</ul>
<h3>Step 3</h3>
<p>Type this under the <strong>entry</strong> DIV, in the <strong>single.php</strong> file:</p>
<p><strong>&lt;div class=”comments-template”&gt;<br />
&lt;?php comments_template(); ?&gt;<br />
&lt;/div&gt;</strong></p>
<p><img class="alignnone size-full wp-image-674" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/comments-template.gif" alt="comments-template" width="300" height="227" /></p>
<p>The <strong>comments_template()</strong> function is what calls for the comments template from the <strong>comments.php</strong> file. The comments.php file then follow its template (or codes) to display the comments listing. Each item in the listing is a comment.</p>
<p>You can also use the <strong>comments_template()</strong> function in the <strong>page.php</strong> file to allow people to comment on them too. Whether to do that is up to you. If you like, repeat step 3 for <strong>page.php</strong>.</p>
<h3>Step 4</h3>
<p>Step four is validate, validate, and validate your codes some more. However, there is no step four because you’re using my <strong>cleaned-up</strong> and modified version of the default comments template. <strong>I’ve validated the codes for you</strong>.</p>
<p>To validate offline:</p>
<ul>
<li>Go to <strong>View &gt; Page Source</strong> or <strong>Source</strong>.</li>
<li>Copy all the source codes.</li>
<li>Go to the <a href="http://validator.w3.org/">validator</a>.</li>
<li>Paste your codes in the <strong>Direct Input</strong> box.</li>
<li>Click <strong>Check</strong>.</li>
</ul>
<p>For future reference (when you build your own theme and comments template), here are the pages to validate:</p>
<ul>
<li>Home page</li>
<li>Archive pages</li>
<li>Category pages (if you customize category pages)</li>
<li>Search result pages</li>
<li>Pages (i.e: About)</li>
<li>Single post view page</li>
<li>Single post with no comments</li>
<li>Single post with comments</li>
<li>Single post with must login message</li>
<li>Single post with no login required message</li>
<li>Password protected single post with comments</li>
</ul>
<h3>Further Comments Template Explanations</h3>
<ul>
<li>The comments template is basically one <strong>Ordered List</strong> (OL), not unordered. Although, they basically work the same way. Unordered is organized by bullet listing. Ordered is organized by number listing (each item has a number, starting from one).</li>
<li>In the <strong>single.php</strong> file, you wrapped the <strong>comments-template</strong> DIV around <strong>comments_template()</strong>. Now, your comments template is an ordered list within a DIV.</li>
</ul>
<p>When you password protect your post, your comments option is also password protected:</p>
<p><img class="alignnone size-full wp-image-675" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/password-protected.gif" alt="password-protected" width="435" height="61" /></p>
<p>The modified version of comments template that you’re using has an H2 sub-heading that says <strong>Password Protected</strong>. The default comments template doesn’t have that.</p>
<p><strong>Here’s what makes up the comments listing</strong>:</p>
<p><img class="alignnone size-full wp-image-676" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/comments-template-core.gif" alt="comments-template-core" width="320" height="384" /></p>
<p><strong>And here’s what that actually means</strong>:</p>
<p><img class="alignnone size-full wp-image-677" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/comments-template-simple.gif" alt="comments-template-simple" width="299" height="212" /></p>
<p>The <strong>comment_text()</strong> function is what calls for each comment.</p>
<p>I will not explain what the CSS codes for the comments template means. Unlike the codes in the <strong>comments.php</strong> file, you can actually play with the CSS codes without breaking the comments template. They’ll do you more good if you play with them instead of reading an explanation from me.</p>
<p><strong>And guess what? There’s no lesson review, today. You’re done.</strong></p>
<p>The initial batch of lessons for this tutorial series is complete. Future lessons will cover more advance design and styling techniques.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-16-comments-template%2F&amp;linkname=WP%20Theme%20Lesson%20%2316%3A%20Comments%20Template" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-16-comments-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #15: Sub-Template Files</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-15-sub-template-files/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-15-sub-template-files/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 09:50:54 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=667</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. To continue with where we left off, you’re going to create more sub-template files like yesterday’s header.php, sidebar.php, and footer.php files. Now that the index.php file’s divided, it gets even easier. &#160; Step 1 Before you do this step, look at the Sidebar, click on an [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p>To continue with where we left off, you’re going to create more sub-template files like yesterday’s <strong>header.php</strong>, <strong>sidebar.php</strong>, and <strong>footer.php</strong> files.</p>
<p>Now that the <a href="http://abhi.com.np/blog/wordpress/wp-theme-lesson-14-footer-and-dividing-index/">index.php file’s divided</a>, it gets even easier.</p>
<p>&nbsp;</p>
<h3>Step 1</h3>
<p>Before you do this step, look at the Sidebar, click on an Archives link. The resulting page doesn’t look different from your front page right?</p>
<ul>
<li>Create a new file: <strong>archive.php</strong></li>
<li>Copy and paste everything from <strong>index.php</strong> to <strong>archive.php</strong></li>
<li>Save archive.php</li>
<li>In the archive.php file, change <strong>the_content</strong> to <strong>the_excerpt</strong>.</li>
<li>Save the archive.php file again.</li>
</ul>
<p>By creating an <strong>archive.php</strong> file and changing it to make it different from <strong>index.php</strong>, you are <strong>customizing</strong> the appearance of <strong>archive pages</strong>.</p>
<p>Now, if you refresh your archive page, it will give you only excerpts, not the full posts.</p>
<p><strong>Why would you want to do this?</strong> &#8211; to prevent Google from penalizing your blog for having duplicate content. If one of the archive pages and the front page display the same content, that’s duplicate content.</p>
<p><strong>What if you have a private blog?</strong> Then, it’s not necessary to distinguish the archive pages from the front page. That’s not to say excerpts aren’t useful for private blogs.</p>
<p><strong>Also</strong> &#8211; By default, your <strong>category pages</strong> will look for instructions on how to display content from the <strong>archive.php</strong> file. If you don’t have an <strong>archive.php</strong> file, category pages will look for <strong>index.php</strong>.</p>
<p>If you want the <strong>category pages</strong> to look different the <strong>front page</strong> and <strong>archive pages</strong>, create a <strong>category.php</strong> file and customize it.</p>
<h3>Step 2</h3>
<ul>
<li>Create a new file: <strong>search.php</strong></li>
<li>Copy and paste everything from <strong>archive.php</strong> to <strong>search.php</strong></li>
<li>Save and you’re done.</li>
</ul>
<p>Now, all search results will be returned as excerpts. Without the <strong>search.php</strong> template file, the search option looks to <strong>index.php</strong> on how to display search results.</p>
<p>(Optional) You can go back to <a href="http://abhi.com.np/blog/wordpress/wp-theme-lesson-1-intro/">lesson one</a> to review the hierarchy.</p>
<h3>Step 3</h3>
<ul>
<li>Create two new files: <strong>page.php</strong> and <strong>single.php</strong></li>
<li>Copy and paste everything from <strong>index.php</strong> to <strong>page.php</strong> and <strong>single.php</strong>. (For now, page and single should be the same.)</li>
<li>Save page and single. Close index. Close single.</li>
</ul>
<h3>Step 4</h3>
<p>There’s a difference between a <strong>Page</strong> and a <strong>page</strong> remember? The <strong>page.php</strong> template customizes the look of those special <strong>Pages</strong>.</p>
<p>First, in <strong>page.php</strong>, type the following codes under <strong>&lt;?php the_content(); ?&gt;</strong>:</p>
<p><strong>&lt;?php link_pages(’&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; ‘, ‘&lt;/p&gt;’, ‘number’); ?&gt;</strong></p>
<p>and</p>
<p><strong>&lt;?php edit_post_link(’Edit’, ‘&lt;p&gt;’, ‘&lt;/p&gt;’); ?&gt;</strong></p>
<p>Second, remove the <strong>postmetadata</strong> codes from <strong>page.php</strong>. Here’s what you should have without postmetadata.<br />
<img class="alignnone size-full wp-image-668" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/page-php.gif" alt="page-php" width="399" height="128" /></p>
<p>Third, remove the <strong>posts_nav_link()</strong> or <strong>navigation</strong> block from <strong>page.php</strong>.<br />
<img class="alignnone size-full wp-image-669" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/remove-navigation.gif" alt="remove-navigation" width="385" height="123" /></p>
<p><strong>What just happened?</strong><br />
The first line of codes was for displaying links to sub-pages.</p>
<p><img class="alignnone size-full wp-image-670" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/nextpage1.gif" alt="nextpage" width="324" height="175" /></p>
<p>For example, edit your <strong>About</strong> page. Follow my screenshot below for what to add.</p>
<p><img class="alignnone size-full wp-image-671" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/add-nextpage.gif" alt="add-nextpage" width="290" height="292" /></p>
<p>This is useful for when you have to break down one REALLY long page into multiple pages.</p>
<p>For the second line of codes, it’s your administrator-only <strong>Edit</strong> link.</p>
<p>Your Pages don’t have categories attached to them and you usually don’t want to show a time stamp for them either so that’s why you removed the postmetadata. You also removed the <strong>posts_nav_link()</strong> codes because the <strong>Page</strong> pages don’t display <strong>Next page </strong>and <strong>Previous page</strong> links.</p>
<p>Save the <strong>page.php </strong>file and close it.</p>
<h3>Step 5</h3>
<p>Clicking on a post title to read the rest of an entry takes you to the single post view. <strong>single.php</strong> template handles the appearance of the single post view.</p>
<p>In <strong>single.php</strong>, type this under <strong>&lt;?php the_content() ?&gt;</strong>:</p>
<p><strong>&lt;?php link_pages(’&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; ‘, ‘&lt;/p&gt;’, ‘number’); ?&gt;</strong></p>
<p>Yes, that is the same line of codes for sub-page links. Did you know you can also break down posts into multiple sub-posts?</p>
<p>Second, in the <strong>postmetadata</strong> area, remove the <strong>&lt;?php comments_popup_link(); ?&gt;</strong> function and the <strong>&lt;br /&gt;</strong> tag before it. Don’t remove the whole <strong>postmetadata</strong>.</p>
<p>You removed the comments link function because it doesn’t work on single post view so there’s no use in having it in the single.php file. Without the number of comments link, there’s only the invisible, administrator-only, Edit link, left after the <strong>BR</strong> tag. You don’t want to skip-a-line for an INVISIBLE link that only you can see right? That’s why you removed the <strong>BR</strong> tag.</p>
<p>Third, replace <strong>&lt;?php posts_nav_link(); ?&gt;</strong> with:</p>
<p><strong>&lt;?php previous_post_link(’&amp;laquo; %link’) ?&gt; &lt;?php next_post_link(’ %link &amp;raquo;’) ?&gt;</strong></p>
<p>On front, archive, category, and search pages, you use the <strong>posts_nav_link()</strong> function to call for <strong>Next page</strong> and <strong>Previous page</strong> links. For the single post view page, there’s no Next page or Previous page link. You use the <strong>previous_post_link()</strong> and <strong>next_post_link()</strong> functions to call for the previous and next post links.</p>
<p>Save the <strong>single.php</strong> file. Go to a single post view page to see the difference in the navigation area.</p>
<h3>Lesson Review</h3>
<ul>
<li>You created four new files or sub templates:<a href="http://abhi.com.np/blog/wp-content/uploads/2009/10/archive-lession-15.txt">archive.php</a>, search.php, <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/page-lession-15.txt'>page.php</a>, and <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/single-lession-15.txt'>single-lession-15</a>.</li>
<li>The <strong>archive.php</strong> and <strong>search.php</strong> templates are the same.</li>
<li><strong>Pages</strong> (different from posts) don’t have categories attached to them. They also don’t have <strong>Next</strong> and <strong>Previous</strong> page links.</li>
<li><strong>Single.php</strong> can’t display the number of comments link (called for by the <strong>comments_popup_link()</strong> function) and it doesn’t use <strong>posts_nav_link()</strong> to call for navigation links.</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-15-sub-template-files%2F&amp;linkname=WP%20Theme%20Lesson%20%2315%3A%20Sub-Template%20Files" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-15-sub-template-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #14: Footer and Dividing Index</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-14-footer-and-dividing-index/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-14-footer-and-dividing-index/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 09:42:59 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=660</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. Today, we wrap up styling and start dividing the index.php file into multiple small files. You’ll need the style.css early in today’s lesson. Later, you’ll work with index.php along with creating some new files. Finally huh? Yes, you’re almost done. Open Xampp, theme’s folder, Firefox, IE, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p>Today, we wrap up styling and start dividing the <strong>index.php</strong> file into multiple small files. You’ll need the <strong>style.css</strong> early in today’s lesson. Later, you’ll work with <strong>index.php</strong> along with creating some new files. Finally huh? Yes, you’re almost done.</p>
<p>Open Xampp, theme’s folder, Firefox, IE, index.php, and style.css.</p>
<h3>Step 1</h3>
<p>Add a <strong>10px</strong> top padding to the <strong>footer</strong> DIV. You remember how to add padding right? I’m not giving you the codes this time.</p>
<h3>Step 2</h3>
<p>Give all <strong>P</strong> tags under within the footer an <strong>18px</strong> line-height. That’s <strong>#footer p{}</strong>. (You’re done with style.css for today.)</p>
<h3>Step 3</h3>
<ul>
<li>Create a new file, name it <strong>header.php</strong>. Make sure the result is a PHP file, not a text document.</li>
<li>In the <strong>index.php</strong> file, start coping from the end of the <strong>header</strong> DIV to everything above it. Paste it in the <strong>header.php</strong> file.</li>
</ul>
<p><img class="alignnone size-full wp-image-661" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/create-headerphp.gif" alt="create-headerphp" width="136" height="92" /></p>
<p><img class="alignnone size-full wp-image-662" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/copy-header.gif" alt="copy-header" width="262" height="244" /></p>
<p>Here’s my <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/header-lession-14.txt'>header.php</a> file. Don’t copy and paste from my file. Copy and paste from your <strong>index.php</strong> file.</p>
<h3>Step 4</h3>
<p>For everything that you’ve copied and pasted in the index.php. Still in the index.php file, replace it with:</p>
<p><strong>&lt;?php get_header(); ?&gt;</strong></p>
<p><img class="alignnone size-full wp-image-663" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/get-header.gif" alt="get-header" width="298" height="203" /></p>
<p>is a function within the WordPress theme system to speficially include the header.php file, instead using <strong>&lt;?php include (TEMPLATEPATH . ‘/header.php’); ?&gt;</strong>.</p>
<p>Save and refresh the browsers. You should see no changes. If your theme look broken after you made the change then there’s a mistake.</p>
<h3>Step 4</h3>
<ul>
<li>Step 4 is more of the same thing. This time, create the <strong>sidebar.php</strong> file.</li>
<li>From the beginning of the <strong>Sidebar</strong> DIV to the end of it, copy and paste into the <strong>sidebar.php</strong> file.</li>
<li>Then, in the <strong>index.php</strong> file, replace it with <strong>&lt;?php get_sidebar(); ?&gt;</strong>.</li>
<li>Save and refresh the browsers. Again, you should see no changes.</li>
<li>Here’s my <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/sidebar-lession-14.txt'>sidebar.php</a> file.</li>
</ul>
<p><img class="alignnone size-full wp-image-664" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/get-sidebar.gif" alt="get-sidebar" width="227" height="229" /></p>
<h3>Step 5</h3>
<ul>
<li>Repeat the steps above for the <strong>footer.php</strong> file.</li>
<li>Here’s my<a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/footer-lession-14.txt'>footer.php</a> file.</li>
</ul>
<p><img class="alignnone size-full wp-image-665" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/get-footer.gif" alt="get-footer" width="180" height="131" /></p>
<h3>Lesson review</h3>
<ul>
<li>You created three new files: <strong>header.php</strong>, <strong>sidebar.php</strong>, and <strong>footer.php</strong>.</li>
<li>You learned three new functions: <strong>get_header()</strong>, <strong>get_sidebar()</strong>, and <strong>get_footer()</strong>.</li>
<li>The following are my files by the end of this lesson: <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/index-lession-14.txt'>index</a>, <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/style-lession-14.txt'>style</a>, <a href="http://abhi.com.np/blog/wp-content/uploads/2009/10/header-lession-14.txt">header</a>, <a href="http://abhi.com.np/blog/wp-content/uploads/2009/10/sidebar-lession-14.txt">sidebar</a>, <a href="http://abhi.com.np/blog/wp-content/uploads/2009/10/footer-lession-14.txt">footer</a>. Don’t just copy and paste or use them to replace your own files. If you’re getting errors or your theme isn’t displaying correctly, check your codes against mine.</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-14-footer-and-dividing-index%2F&amp;linkname=WP%20Theme%20Lesson%20%2314%3A%20Footer%20and%20Dividing%20Index" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-14-footer-and-dividing-index/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #13: Styling Sidebar</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-13-styling-sidebar/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-13-styling-sidebar/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 08:09:16 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=647</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. After styling the Sidebar, this tutorial series will be almost over. Already? Yes, but don’t worry. I’ll follow up with case studies (break down of how I created my themes). Again, you don’t need the index.php file today. Open Xampp, theme’s folder, Firefox, IE, and style.css [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p>After styling the Sidebar, this tutorial series will be almost over. Already? Yes, but don’t worry. I’ll follow up with case studies (break down of how I created my themes).</p>
<p>Again, you don’t need the index.php file today. Open Xampp, theme’s folder, Firefox, IE, and style.css in Notepad.</p>
<h3>Step  1</h3>
<p>Type this under <strong>.sidebar{}</strong>:</p>
<p><strong>.sidebar ul{<br />
list-style-type: none;<br />
margin: 0;<br />
padding: 0 10px 0 10px;<br />
}</strong></p>
<p>Now that you’ve styled the parent unordered list (UL) tag for the Sidebar, all child ULs or nested ULs will inherit the same style. In this case, it’s <strong>none</strong>,<strong> zero margin</strong>, and <strong>10-pixel side paddings</strong>.</p>
<p>For example:</p>
<p><img class="alignnone size-full wp-image-648" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/inheritance.gif" alt="inheritance" width="205" height="134" /></p>
<p>The second-level (or nesting) UL inherits the styles from the first UL. If you apply a border to the first UL, the second UL will also get a border.</p>
<p>Save and refresh to see that your list items (LI) are no longer bulleted.</p>
<p>Notice how you add padding to the top and bottom.</p>
<p><img class="alignnone size-full wp-image-649" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/no-top-padding.gif" alt="no-top-padding" width="260" height="170" /></p>
<h3>Step 2</h3>
<p>Type this under <strong>.sidebar ul{}</strong>:</p>
<p><strong>.sidebar ul li{<br />
padding: 10px 0 10px 0;<br />
}</strong></p>
<p>Here’s the padding now:</p>
<p><img class="alignnone size-full wp-image-650" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/top-padding.gif" alt="top-padding" width="260" height="170" /></p>
<p><strong>Why not add the 10-pixel padding to the UL tag in the first place?</strong> You need a way to separate one LI from another. Before the added padding to <strong>.sidebar ul li{}</strong>, there was no space in between the search form and calendar and no space in between <strong>Calendar</strong> and <strong>Pages</strong>. The spacing in between each block is what 10-pixel top and bottom paddings for <strong>.sidebar ul li{}</strong> are for. If the UL tag had padding for all four sides instead of just left and right (0 10px 0 10px), you would end up with a 20px top padding or 20px bottom padding in trying to separate the LIs after padding the UL. Get what I’m saying?</p>
<p>If you don’t, go ahead and add top and bottom padding for <strong>.sidebar ul{}</strong>.</p>
<h3>Step 3</h3>
<p>Type this under <strong>.sidebar ul li{}</strong>:</p>
<p><strong>.sidebar ul li h2{<br />
font-family: Georgia, Sans-serif;<br />
font-size: 14px;<br />
}</strong></p>
<p>Remember that styling the sub-heading under .post{} didn’t matter because you were targetting sub-headings only under .post{}? Now, you’re styling the unaffected sub-headings in the Sidebar. Here’s the result:</p>
<p><img class="alignnone size-full wp-image-651" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/h2-and-unnecessary-padding.gif" alt="h2-and-unnecessary-padding" width="254" height="414" /></p>
<p>That’s how my <strong>Pages</strong> links listing looks. You probably have only one link, <strong>About</strong>. I added multiple links or page levels to my offline WordPress install to test and see how lower level links would look. Notice the unnecessary extra padding at the bottom that I circled. That’s a perfect example of style inheritance. Instead of 10 pixels, it’s 20 pixels.</p>
<p>Because you added padding to <strong>.sidebar ul li{}</strong>, the lower level <strong>LI</strong>s inherited that padding. To fix it, do Step 4.</p>
<h3>Step 4</h3>
<p>Type this under .sidebar ul li h2{}:</p>
<p><strong>.sidebar ul ul li{<br />
padding: 0;<br />
}</strong></p>
<p>The consecutive <strong>UL</strong>s in <strong>.sidebar ul ul li{}</strong> indicates that you’re targeting the lower level <strong>LI</strong>s. Again, when all values are 0, you don’t need the px suffix.</p>
<p>Here’s the result:</p>
<p><img class="alignnone size-full wp-image-652" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/ul-ul-li.gif" alt="ul-ul-li" width="252" height="218" /></p>
<p>The line spacing is too close so lets make the line height equal 24px.</p>
<p>Add <strong>line-height: 24px;</strong> to <strong>.sidebar ul ul li{}</strong>.</p>
<p><img class="alignnone size-full wp-image-654" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/line-height1.gif" alt="line-height" width="190" height="74" /></p>
<p>By the way, if you’re getting extra spacing under the search form in Internet Explorer. Add form to:</p>
<p>body, h1, h2, h3, h4, h5, h6, address, blockquote, dd, dl, hr, p{<br />
margin: 0;<br />
padding: 0;<br />
}</p>
<p>like this:</p>
<p>body, h1, h2, h3, h4, h5, h6, address, blockquote, dd, dl, hr, p<strong>, form</strong>{<br />
margin: 0;<br />
padding: 0;<br />
}</p>
<h3>Step 5 (Optional)</h3>
<p>Do this step if you want the calendar dates to stretch and cover the full sidebar width. Your calendar currently looks like this:</p>
<p><img class="alignnone size-full wp-image-655" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/calendar1.gif" alt="calendar1" width="251" height="186" /></p>
<p>To style the calendar, find out tag it’s sitting in and what the name or id of that tag. To do that, go to <strong>View &gt; Page Source or Source</strong>. Your sidebar is at the bottom so go to the bottom of the source codes and look for the Calendar.</p>
<p><img class="alignnone size-full wp-image-656" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/caledar-id.gif" alt="caledar-id" width="287" height="101" /></p>
<p>Now that you know the calendar sits in a <strong>TABLE</strong> tag with <strong>wp-calendar</strong> as <strong>id</strong>. How do you target the <strong>wp-calendar table</strong> in in the <strong>style.css</strong> file?</p>
<p><strong>table#wp-calendar{}</strong> is the answer. Why? Earlier, you learned to use the pound sign when styling DIV named with an <strong>id</strong> instead of a <strong>class</strong>. In this case, it’s a <strong>table</strong> instead of a <strong>DIV</strong>, with an <strong>id</strong> value, <strong>wp-calendar</strong>.</p>
<p>#wp-calendar{} would work because it’s unique and WordPress doesn’t use #wp-calendar for any other tag. But, you should try to be specific when you can. If you want to be more specific, use <strong>.sidebar ul li table#wp-calendar{}</strong>. Even more specific? Fine, use <strong>.sidebar ul li#calendar table#wp-calendar{}</strong>. That’s because the list item (LI) containing the Calendar sub-heading and Calendar TABLE has an <strong>id</strong> named <strong>calendar</strong>.</p>
<p>Now that you know what to use, how do you make the table stretch? Use <strong>width: 100%;</strong> for the table.</p>
<p>Type this under <strong>.sidebar ul ul li{}</strong>:</p>
<p>table#wp-calendar{<br />
width: 100%;<br />
}</p>
<p>Save and refresh. Here’s the result:</p>
<p><img class="alignnone size-full wp-image-657" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/calendar-width.gif" alt="calendar-width" width="250" height="176" /></p>
<p><strong>width: 100%;</strong> because you want the Calendar table to adjust to the width of the Sidebar, no matter how many pixels you want to change the Sidebar to.</p>
<p>It doesn’t look good, but you’re learning how to do it, in case you want to. This calendar needs more styling to look right. <strong>Hint</strong>: Look in source codes again, find out what tags under the <strong>TABLE</strong> that you can style.</p>
<p>That’s the end of today’s lesson.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-13-styling-sidebar%2F&amp;linkname=WP%20Theme%20Lesson%20%2313%3A%20Styling%20Sidebar" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-13-styling-sidebar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #12: Post Formatting and Miscellaneous</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-12-post-formatting-and-miscellaneous/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-12-post-formatting-and-miscellaneous/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:46:35 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=644</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. You don’t need index.php today. Open Xampp Control, theme folder, Firefox, Internet Explorer, and style.css. Before we start, forget yesterday’s screenshot that I showed you. I had the widget plugin turned on while taking the screenshot, which explains why my sidebar looked different from yours. Also, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p>You don’t need index.php today. Open <strong>Xampp Control</strong>, <strong>theme folder</strong>, <strong>Firefox</strong>, <strong>Internet Explorer</strong>, and <strong>style.css</strong>.</p>
<p>Before we start, forget yesterday’s screenshot that I showed you. I had the widget plugin turned on while taking the screenshot, which explains why my sidebar looked different from yours. Also, in the style.css file, change all Sans-seriff to <strong>Sans-serif</strong>. My mistake again, I tend to add an extra ‘F’ to Sans-serif.</p>
<h3>Step 1</h3>
<p>Get rid of most margins and paddings by typing the following codes above the <strong>body{}</strong> in <strong>style.css</strong>:</p>
<p><strong>body, h1, h2, h3, h4, h5, h6, blockquote, p{<br />
margin: 0;<br />
padding: 0;<br />
}</strong></p>
<ul>
<li>Notice that it’s <strong>margin: 0;</strong> instead of <strong>margin: 0 0 0 0;</strong>. When all your values are the same, use one number. Same goes for padding.</li>
<li>Save your file. Refresh Firefox and Internet Explorer. Don’t worry, now you’ll add in the margins and paddings where you actually want them to appear, and not where the browsers want them by default.</li>
</ul>
<p>By the way, I’m telling you to put this and that under or above this or that, but know that it’s optional. You can type/place your codes anywhere. The way I’m doing it is how I organize.</p>
<h3>Step 2</h3>
<p>Style H1 title, type this under the <strong>body{}</strong>:</p>
<p><strong>h1{<br />
font-family: Georgia, Sans-serif;<br />
font-size: 24px;<br />
padding: 0 0 10px 0;<br />
}</strong></p>
<ul>
<li><strong>font-family: Georgia, Sans-seriff;</strong> changes the H1 title front from Arial to Georgia. Without Georgia, the web page looks for Sans-serif;</li>
<li><strong>font-size: 24px;</strong> is self-explanatory. However, notice that when you set the font size to <strong>12px</strong> within <strong>body{}</strong>, the <strong>H1</strong> and <strong>H2</strong> tags didn’t follow that rule. That’s because heading tags follow their own rules. To control them, you need to style specifically for them.</li>
<li><strong>padding: 0 0 10px 0;</strong> means 10-pixel bottom padding. It’s for adding space between your blog’s title and description.</li>
</ul>
<p>Save, refresh, and here’s the result:</p>
<p><img class="alignnone size-full wp-image-645" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/h1-styled.gif" alt="h1-styled" width="365" height="89" /></p>
<h3>Step 3</h3>
<p>Type the following codes under <strong>#container{}</strong>: (Save and refresh after each block of codes to see what the changes are.)</p>
<p><strong>.post{<br />
padding: 10px 0 10px 0;<br />
}</strong></p>
<p>(You added 10-pixel top and bottom paddings to each DIV with a class named, <strong>post</strong>.)</p>
<p><strong>.post h2{<br />
font-family: Georgia, Sans-serif;<br />
font-size: 18px;<br />
}</strong></p>
<p>(.post h2 is not a general rule. It specifically targets the H2 sub-headings within the post DIV. The H2 sub-headings in the Sidebar aren’t affected.)</p>
<p><strong>.entry{<br />
line-height: 18px;<br />
}</strong></p>
<p>(Increased the size of the space between each line within the entry DIV.)</p>
<h3>Step 4</h3>
<p>Type the following codes under <strong>a:hover{}</strong>:</p>
<p><strong>p{<br />
padding: 10px 0 0 0;<br />
}</strong></p>
<p>(10-pixel top padding to each paragraph tag.)</p>
<h3>Step 5</h3>
<p>Type under <strong>.entry{}</strong>:</p>
<p><strong>p.postmetadata{<br />
border-top: 1px solid #ccc;<br />
margin: 10px 0 0 0;<br />
}</strong></p>
<p>Remember the pargraph tag that you gave a class named, <strong>postmetadata</strong>, to? Styling a specific paragraph tag and styling DIV are very much the same. You can apply border, margin, padding, and background to both.</p>
<p>For the <strong>postmetadata</strong> paragraph tag, you added a gray border and a 10-pixel top margin to it.</p>
<p><strong>border-top</strong> means top border only. <strong>border-left</strong> means left border only. Etc. <strong>border</strong>, alone, without <strong>-top</strong>, <strong>-right</strong>, <strong>-bottom</strong>, or <strong>-left</strong> means all borders. For example, <strong>border: 1px solid #ccc;</strong> means all four sides have a gray 1px border.</p>
<h3>Step 6</h3>
<p>Type under <strong>p.postmetadata{}</strong>:</p>
<p><strong>.navigation{<br />
padding: 10px 0 0 0;<br />
font-size: 14px;<br />
font-weight: bold;<br />
line-height: 18px;<br />
}</strong></p>
<p>For the <strong>navigation</strong> DIV wrapping the <strong>Next page</strong> and <strong>Previous page</strong> links, you just:</p>
<ul>
<li>added a 10-pixel top padding</li>
<li>change its font size to 14px</li>
<li>change its font-weight to bold.</li>
<li>increased its line-height to 18px.</li>
</ul>
<p>That’s the end of today’s lesson.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-12-post-formatting-and-miscellaneous%2F&amp;linkname=WP%20Theme%20Lesson%20%2312%3A%20Post%20Formatting%20and%20Miscellaneous" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-12-post-formatting-and-miscellaneous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #11: Widths and Floats</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-11-widths-and-floats/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-11-widths-and-floats/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:42:24 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=642</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. This lesson will cover how to set the width for each DIV (or invisible box) and how to arrange them. It’ll also show you some work-arounds to get your theme to display right or look the same in both Firefox and Internet Exlporer. Before we start, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p>This lesson will cover how to set the width for each DIV (or invisible box) and how to arrange them. It’ll also show you some work-arounds to get your theme to display right or look the same in both Firefox and Internet Exlporer.</p>
<p>Before we start, open the following items: <strong>Xampp Control</strong>, <strong>theme folder</strong>, <strong>Firefox </strong> browser, <strong>Internet Explorer</strong> browser, <strong>index.php</strong>, and <strong>style.css</strong>.</p>
<h3>Step 1</h3>
<p>The first thing you want to do is decide what’s going to be the overall width of your theme. We’ll use 750px (750 pixels); each 100-pixel is one inch. Your theme depends on the view specs of the majority of your blog’s visitors. What you want to avoid is using a 900px theme for an audience that uses mostly 800px by 600px resolutions, which means your 900px theme would expand 100 pixels beyond their screens. That’s a no-no.</p>
<p><strong>How do you limit the overall width to 750px anyway?</strong><br />
You need everything to sit within a 750px box or DIV. Everything includes: header, container, sidebar, and footer.</p>
<p>Add: <strong>&lt;div id=”wrapper”&gt;</strong> after <strong>&lt;body&gt;</strong><br />
Add: <strong>&lt;/div&gt;</strong> before <strong>&lt;/body&gt;</strong></p>
<p>Type the following in <strong>style.css</strong>:<br />
<strong>#wrapper{<br />
margin: 0 auto 0 auto;<br />
width: 750px;<br />
text-align: left;<br />
}</strong></p>
<p>In CSS, speficially in style.css, the pound sign (<strong>#</strong>) is how you address a DIV with an <strong>id</strong>. The period is how you address a DIV with a <strong>class</strong>. For a class example, if your codes were <strong>&lt;div class=”wrapper”&gt;</strong> then use <strong>.wrapper</strong> instead of <strong>#wrapper</strong> to address the <strong>wrapper </strong>DIV.</p>
<p>Save both the index.php and style.css files. Refresh the Firefox and Internet Explorer browsers (press F5) to see the change.</p>
<h4>Further explanations</h4>
<ul>
<li><strong>margin: 0 auto 0 auto;</strong> means (in exact order) <strong>0 top margin</strong>, <strong>auto right margin</strong>, <strong>0 bottom margin</strong>, and <strong>left auto margin</strong>. For now, just remember that setting right and left margins to auto is centerting.</li>
<li><strong>width: 750px;</strong> is self-explanatory.</li>
<li><strong>text-align: left;</strong> is aligning the text to the left within the <strong>wrapper DIV</strong> because you will be changing <strong>body{ text-align: left;}</strong> to <strong>text-align: center;</strong></li>
</ul>
<h3>Step 2</h3>
<p>Go ahead and change <strong>text-align: left;</strong> within <strong>body{}</strong> to <strong>text-align: center;</strong></p>
<p><strong>Why</strong>? (I’m assuming you’re using Firefox and Internet Explorer 6). Your layout might look right to you, but not to people using earlier versions of Internet Explorer. Remember setting right and left margins to auto is centering? Well, that doesn’t work for all Internet Explorers so <strong>body{ text-align: center; }</strong> is a fix for older IEs to center the <strong>wrapper</strong> DIV or box.</p>
<p>(By the way, the text sizes in Firefox and Internet Explorer are different right now. We’ll fix that later.)</p>
<h3>Step 3</h3>
<p>Make the <strong>Header</strong> float left with a 750px width:</p>
<p><strong>#header{<br />
float: left;<br />
width: 750px;<br />
}</strong></p>
<h3>Step 4</h3>
<p>Make the <strong>Container</strong> float left with a 500px width:</p>
<p><strong>#container{<br />
float: left;<br />
width: 500px;<br />
}</strong></p>
<h3>Step 5</h3>
<p>Make the <strong>Sidebar</strong> float left with a 240px width and a gray background: (10px is missing; I know.)</p>
<p><strong>.sidebar{<br />
float: left;<br />
width: 240px;<br />
background: #eeeeee;<br />
}</strong></p>
<p>Notice, you did not use a pound sign to address the <strong>Sidebar</strong> DIV; you used a period. Also, remember #ffffff is white? <strong>background: #eeeeee;</strong> is very light gray. You added a background color to the Sidebar just to see the difference when you’ll add the remaining 10 pixels later.</p>
<h3>Step 6</h3>
<p>Make the <strong>Footer</strong> float left and clear both with a 750px width:</p>
<p><strong>#footer{<br />
clear: both;<br />
float: left;<br />
width: 750px;<br />
}</strong></p>
<p>What’s the difference between the <strong>Header</strong> and <strong>Footer</strong> stylings? The answer is the presense of <strong>clear: both;</strong> in <strong>footer{}</strong>. It’s there to make sure the Footer doesn’t attach itself to anything above it, like the Sidebar or Container.</p>
<p><strong>Save the style.css file. Refresh the browsers.</strong></p>
<h3>Step 7</h3>
<p>Add the remaining 10 pixels to the Sidebar by using a margin. Now your sidebar style codes look like this:</p>
<p>.sidebar{<br />
float: left;<br />
width: 240px;<br />
background: #eeeeee;<br />
<strong>margin: 0 0 0 10px;</strong><br />
}</p>
<p>Save file and refresh the browsers to see a 10-pixel space added to the left of the Sidebar.<br />
<strong>margin: 0 0 0 10px;</strong> specifically means 0 top, 0 right, 0 bottom, 10px left. When size is 0, the <strong>px</strong> suffix isn’t necessary.</p>
<h3>Step 8 (Extra step)</h3>
<p>This is just in case you’re getting a 20px margin instead of a 10px margin. 20px margin would break your layout and push the sidebar to the bottom of the page because a 20px margin makes the sum of the Container and Sidebar widths equal 760px instead of 750px. This extra step is <strong>Internet Explorer’s</strong> fault because the bug of doubling the set margin doesn’t exist in Firefox.</p>
<p>To fix this bug, add <strong>display: inline;</strong> to the Sidebar. Now your Sidebar should be:</p>
<p>.sidebar{<br />
float: left;<br />
width: 240px;<br />
background: #eeeeee;<br />
margin: 0 0 0 10px;<br />
<strong>display: inline;</strong><br />
}</p>
<p>That’s the end of today’s lesson. If you have any question, feel free to ask me. I’m here to help, not just to show you the ropes.</p>
<p>And here’s what I have in the <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/index-lesson-11.txt'>index</a> and <a href='http://abhi.com.np/blog/wp-content/uploads/2009/10/style-lesson-11.txt'>style</a> files.</p>
<p><strong>If you’ve read the first version of this lesson, forget the screenshot that I showed you. When taking the screenshot, I forgot to turn off the widget plugin for the sidebar, which made the sidebar looked a little different than what you should have.</strong></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-11-widths-and-floats%2F&amp;linkname=WP%20Theme%20Lesson%20%2311%3A%20Widths%20and%20Floats" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-11-widths-and-floats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #10: Hex Codes and Styling Links</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-10-hex-codes-and-styling-links/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-10-hex-codes-and-styling-links/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:37:30 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=637</guid>
		<description><![CDATA[Follow this WordPress Theme Tutorial Series from the beginning. Continuing from yesterday’s introduction to CSS, we’ll do more coloring and learn more about hex codes. The color property, followed by a hexadecimal (hex) code, is for coloring texts (words). For example body { color: #000000;} means all texts (words) in the body of your page [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p>Continuing from yesterday’s introduction to CSS, we’ll do more <strong>coloring</strong> and learn more about <strong>hex codes</strong>. The color property, followed by a hexadecimal (hex) code, is for coloring texts (words). For example body { color: #000000;} means all texts (words) in the body of your page will be black.</p>
<p>The background property, followed by a hex code, is for coloring anything that’s not text. For example, <strong>body{ background: #ffffff; }</strong> means white background for the body.</p>
<h3>Hexadecimal Codes</h3>
<ul>
<li>Preceded by a pound sign (#) each hex code has six digits. Those numbers range from <strong>#ffffff</strong> (white) to <strong>#000000</strong> (black).</li>
<li>#ffffff, #eeeeee, #dddddd, #cccccc, #bbbbbb, #aaaaaa, #999999, #888888, #777777, #666666, #555555, #444444, #333333. #222222, #111111</li>
<li>The first two digits represent red, third and fourth represent green, and last two represent blue. <strong>#ff0000</strong> is red. <strong>#550000</strong> is dark red. <strong>#220000</strong> is darker red. <strong>#00ff00</strong> is green. <strong>#0000ff</strong> is blue. Wait, isn’t yellow a primary color? Which hex code is yellow? <strong>#ffff00</strong> is yellow. <strong>#ff00ff</strong> is violet.</li>
</ul>
<h3>Step 1</h3>
<p>Type the following codes under the the <strong>body{ }</strong> selector:</p>
<p><strong>a:link, a:visited{<br />
text-decoration: underline;<br />
color: #336699;<br />
}</strong></p>
<p><img class="alignnone size-full wp-image-638" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/style-links.gif" alt="style-links" width="254" height="86" /></p>
<ul>
<li><strong>What was that for?</strong> You made sure all your links are underlined (<strong>text-decoration: underline;</strong>) and blue (<strong>color: #336699;</strong>). It’s a different shade of blue and it’s blue because the last two digits (represent blue) are the highest numbers.</li>
<li><strong>a:link</strong> is for styling links. When you want to turn a word into a link, what do you use? The <strong> &lt;a&gt;</strong> and <strong>&lt;/a&gt;</strong> tags, hence, the <strong>A</strong> in <strong>a:link</strong>.</li>
<li><strong>a:visited</strong> is for styling links that have been clicked on (visited pages), hence, <strong>Visited</strong> in <strong>a:visited</strong>.</li>
<li>Instead of typing:<br />
<strong>a:link{<br />
text-decoration: underline;<br />
color: #336699;<br />
}</strong></p>
<p>AND</p>
<p><strong>a:visited{<br />
text-decoration: underline;<br />
color: #336699;<br />
}</strong></li>
<li>You used the <strong>comma</strong> to separate <strong>a:link</strong> and <strong>a:visited</strong> while applying <strong>text-decoration: underline;</strong> and <strong>color: #336699;</strong> to both selectors.</li>
</ul>
<h3>Step 2</h3>
<p>Type the following codes under <strong>a:link, a:visited{ }</strong></p>
<p><strong>a:hover{<br />
text-decoration: none;<br />
}</strong></p>
<p><strong>What was that for?</strong> You made sure that the link underline disappears when you hover the cursor over a link, hence, <strong>Hover</strong> in <strong>a:hover</strong>.</p>
<p>If you don’t want to underline by default and underline when you hover over then switch the <strong>text-decoration:</strong> value for <strong>a:link</strong> and <strong>a:hover</strong>.</p>
<p>If you want change the color of your link on hover then add <strong>color:</strong> and whichever hex code you want. For example:</p>
<p>a:hover{<br />
text-decoration: none;<br />
<strong>color: #ff0000;</strong><br />
}</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-10-hex-codes-and-styling-links%2F&amp;linkname=WP%20Theme%20Lesson%20%2310%3A%20Hex%20Codes%20and%20Styling%20Links" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-10-hex-codes-and-styling-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #9: Style.css and CSS Intro</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-9-style-css-and-css-intro/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-9-style-css-and-css-intro/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:31:02 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=628</guid>
		<description><![CDATA[The best way to learn CSS is to dive right in. Unlike XHTML and PHP, you don’t need to touch the core files of your template. You also don’t need to understand any basic concept. Just dive in. Trial and error is the way to go. Before we start, you should already have some information [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />The best way to learn CSS is to dive right in. Unlike XHTML and PHP, you don’t need to touch the core files of your template. You also don’t need to understand any basic concept. Just dive in. Trial and error is the way to go.</p>
<p>Before we start, you should already have some information in the <strong>style.css</strong> file. Let’s find out what that block of information means right now.</p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-629" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/theme-info.gif" alt="theme-info" width="303" height="209" /></p>
<ul>
<li>First line is the theme’s name, which is self-explanatory.</li>
<li>Second is the location of where your theme is available. If you’re creating a theme for yourself, not for public use, don’t worry about it.</li>
<li>Third line is theme’s description.</li>
<li>Fourth is version number, which is important, especially when you release updated versions of your theme for public use.</li>
<li>Fifth and sixth is your name and home page.</li>
</ul>
<p>The /* and */ signs wrapping around your theme’s information is for preventing the theme’s information from affecting the rest of the page. It’s CSS commenting. While typing CSS codes to style your web page, you might want to add comments here and there to keep track of things. But, you don’t want your comments to affect the codes so you use the /* and */ signs to make your comments invisible.</p>
<p>Here’s the processed theme information:</p>
<p><img class="alignnone size-full wp-image-630" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/theme-info-thumbnail.gif" alt="theme-info-thumbnail" width="267" height="276" /></p>
<p><strong>Step 1</strong>:</p>
<ul>
<li>Open Xampp Control, theme folder, a Firefox browser, an Internet Explorer browser, and the style.css.</li>
<li>Point both browsers to http://localhost/wordpress</li>
</ul>
<p>Here’s where you really need both <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> and Internet Explorer to test your theme. Different systems interpret CSS codes differently. It’s best to test your theme in as many browsers and in as many operating systems as possible (Safari, Opera, Linux, Netscape, etc). If you’re lazy like me, test your themes in only Firefox and Internet Explorer.</p>
<p>(Notice: You don’t need to open <strong>index.php</strong> in Notepad, in this lesson. If you can’t already open the <strong>style.css</strong> with Notepad, right click on your file, select <strong>Properties</strong>, click <strong>Change</strong>, and select Notepad.)</p>
<p><strong>Step 2</strong>:</p>
<p>Type the follow codes in the style.css file:</p>
<p><strong>body{<br />
margin: 0;<br />
font-family: Arial, Helvetica, Georgia, Sans-serif;<br />
font-size: 12px;<br />
text-align: left;<br />
vertical-align: top;<br />
background: #ffffff;<br />
color: #000000;<br />
}</strong></p>
<p>Just like working with XHTML or PHP, add tab spacing for organization:</p>
<p><img class="alignnone size-full wp-image-631" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/add-body.gif" alt="add-body" width="405" height="368" /><br />
Save your style.css file, <strong>refresh</strong> both <strong>Firefox</strong> and <strong>Internet Explorer</strong> browsers to see the change. (You’ll be working with two browsers from now on.)</p>
<p>Treat <strong>body{ }</strong> as a tag and everything in between as attributes and values, just like you did with XHTML. <strong>{</strong> is open. <strong>}</strong> is close. Within the <strong>{</strong> and <strong>}</strong>, the <strong>colon means start</strong> and <strong>semicolon means stop</strong>. (I use the terms tags, attributes, and values when referring to XHTML, PHP, and CSS to keep it simple. In reality, PHP and CSS have different terms for their codes. For example: parameters, selector, and property.)</p>
<p>Before we move on, there’s a reason why you used the <strong>body{ }</strong> (CSS selector) and that’s because you’re working on styling the most basic (or overall) part of the web page, the <strong>&lt;body&gt;</strong> tag. You don’t style the &lt;header&gt; tag because there’s nothing to style. Everything that shows up on your web page sits in within the <strong>&lt;body&gt;</strong> and <strong>&lt;/body&gt;</strong> tags.</p>
<p>However, later on, you will style the DIV box with the ID named <strong>header</strong>.</p>
<p><strong>Further explanations</strong>:</p>
<p><strong>margin: 0;</strong> gets rid of the default margin spacing of the body tag. If you wanted a margin or bigger margin, change the 0 to 10px, 20px, or etcetera. PX means pixels. Each pixel is a dot on your computer screen. When your margin is a 0, there’s no need to follow it with px.</p>
<p>In the image below, the red highlighted space is the default margin spacing applied to the body tag.</p>
<p><img class="alignnone size-full wp-image-632" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/show-margin.gif" alt="show-margin" width="385" height="160" /></p>
<p>After styling it <strong>margin: 0;</strong>, here’s the same page without the margins:</p>
<p><img class="alignnone size-full wp-image-633" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/margin-0.gif" alt="margin-0" width="311" height="208" /></p>
<p><strong>font-family: Arial, Helvetica, Georgia, Sans-serif;</strong> selects which font to use for your web page or website. The fonts following the first one, which is <strong>Arial</strong> in this case, are alternates. If your users don’t have the <strong>Arial</strong> font installed on their computers, the <strong>style.css</strong> file looks for <strong>Helvetica</strong>, then <strong>Georgia</strong>, and then <strong>Sans-serif</strong>. You can find your list of fonts in the <strong>Fonts</strong> folder under <strong>My Computer &gt; Hard Disk &gt; Windows</strong></p>
<p><strong>font-size: 12px;</strong> is self-explanatory. Change it to a smaller or bigger number to see the change.</p>
<p><strong>text-align: left;</strong> aligns your text to the left. Change it to text-align: right; to see the difference.</p>
<p><strong>vertical-align: top;</strong> makes sure everything starts from the top. If you middle or bottom align the body tag, everything will be pushed down.</p>
<p><strong>background: #ffffff;</strong> means white background. #ffffff is the hex code for white. #000000 is the hex codes for black.</p>
<p><strong>color: #000000;</strong> means your text color will be black.</p>
<p>If you want to move ahead or learn CSS on your own, the best place to start at is <a href="http://w3schools.com/css/default.asp">w3schools.com</a></p>
<p>Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-9-style-css-and-css-intro%2F&amp;linkname=WP%20Theme%20Lesson%20%239%3A%20Style.css%20and%20CSS%20Intro" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-9-style-css-and-css-intro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #8: How to Validate</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-8-how-to-validate/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-8-how-to-validate/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:21:26 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=623</guid>
		<description><![CDATA[You need to learn how to validate your codes, before stepping into CSS and working with the style.css file. Validate/Validating/Validation simply means making sure there’s no error. At beginning of this series, I gave you two links to bookmark, XHTML Validator and CSS Validator. For this lesson, you’ll use the XHTML validator. I’ll keep this [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />You need to learn how to validate your codes, before stepping into CSS and working with the <strong>style.css</strong> file. Validate/Validating/Validation simply means making sure there’s no error. At beginning of this series, I gave you two links to bookmark, <a href="http://validator.w3.org/">XHTML Validator</a> and <a href="http://jigsaw.w3.org/css-validator/">CSS Validator</a>. For this lesson, you’ll use the XHTML validator.</p>
<p>I’ll keep this lesson very short and simple because you need to more time to sink in everything you’ve learned about XHTML and PHP. Don’t keep moving forward with my lessons. Take the time to reflect and picture the codes in your head. How do you start an invisible box? What’s the different between an ID and a Class? What PHP function would you use to call for the blog’s title? Blog’s description? The more you picture the more you remember.</p>
<p>After today, you better be ready. When we take on CSS, I’ll dive deep into it because the style.css file is what you’ll work with eighty percent of the time.</p>
<p>For today’s lesson, you need to open only the <strong>Xampp Control</strong> and browser (pointing to <strong>http://localhost/wordpress</strong>).</p>
<p>Looking at the browser, go to <strong>View &gt; Page Source</strong> or <strong>Source</strong>.</p>
<p>Select all. You can do this by clicking and dragging to highlight all the source codes or simply press <strong>Ctrl + a</strong>.</p>
<p>Copy all the source codes. That’s right click and copy or <strong>Ctrl + c</strong>.</p>
<p>Open a tab or another browser pointing to the <a href="http://validator.w3.org/">XHTML Validator</a>.</p>
<p>Go to the bottom of the page, paste the source codes in the <strong>Validate by Direct Input</strong> box. Paste by right click and paste or <strong>Ctrl + v</strong>.<br />
<img class="alignnone size-full wp-image-624" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/paste-codes.gif" alt="paste-codes" width="484" height="344" /></p>
<p>After clicking <strong>Check</strong>, the validator will check your codes, then send you to the results page. If the message is green, then you have no errors.<br />
<img class="alignnone size-full wp-image-625" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/passed-validation.gif" alt="passed-validation" width="373" height="184" /></p>
<p>Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-8-how-to-validate%2F&amp;linkname=WP%20Theme%20Lesson%20%238%3A%20How%20to%20Validate" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-8-how-to-validate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Lesson #7: Footer</title>
		<link>http://abhi.com.np/blog/wordpress/wp-theme-lesson-7-footer/</link>
		<comments>http://abhi.com.np/blog/wordpress/wp-theme-lesson-7-footer/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:09:12 +0000</pubDate>
		<dc:creator>Kedar</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://abhi.com.np/blog/?p=616</guid>
		<description><![CDATA[This lesson on the footer is simple. You’re going to add a DIV or invisible box under the Sidebar DIV and fill in some copyright text for the footer. Think you can do that without my instructions? Go ahead a try it. Come back to this lesson to double check. &#160; &#160; Step 1: Add [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:10px" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/tutorial-series.gif" border="0" alt="" />This lesson on the <strong>footer</strong> is simple. You’re going to add a DIV or invisible box under the Sidebar DIV and fill in some copyright text for the footer. Think you can do that without my instructions? Go ahead a try it. Come back to this lesson to double check.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Step 1</strong>: Add the DIV</p>
<p>Type the following codes under the Sidebar DIV:</p>
<p><strong>&lt;div id=”footer”&gt;</strong></p>
<p><strong>&lt;/div&gt;</strong></p>
<p><img class="alignnone size-full wp-image-617" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/add-footer.gif" alt="add-footer" width="251" height="189" /></p>
<p><strong>Step 2</strong>: Add footer text within paragraph tags. For this, say anything you want. Here’s my message:</p>
<p><strong>&lt;p&gt;<br />
Copyright &#169; 2007 &lt;?php bloginfo(’name’); ?&gt;<br />
&lt;/p&gt;</strong><br />
<img class="alignnone size-full wp-image-618" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/add-footer-text.gif" alt="add-footer-text" width="344" height="89" /></p>
<p>Save notepad and refresh browser. Here’s the result:</p>
<p><img class="alignnone size-full wp-image-619" src="http://abhi.com.np/blog/wp-content/uploads/2009/10/footer.gif" alt="footer" width="321" height="121" /></p>
<p>If you didn’t use the footer text above, <strong>&#169;</strong> is the code for displaying the copyright sign. Also, remember the <strong>bloginfo()</strong> function that you used when putting the header together? I used it again for the footer. ‘<strong>name</strong>‘ calls for the blog’s title and ‘<strong>url</strong>‘ calls for the blog’s address.</p>
<p>If you want the blog’s title to be a link, check the header to remember how you did it.</p>
<p>Follow this <a href="http://abhi.com.np/blog/wordpress/wordpress-theme-design/">WordPress Theme Tutorial Series</a> from the beginning.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fabhi.com.np%2Fblog%2Fwordpress%2Fwp-theme-lesson-7-footer%2F&amp;linkname=WP%20Theme%20Lesson%20%237%3A%20Footer" target="_blank"><img src="http://abhi.com.np/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://abhi.com.np/blog/wordpress/wp-theme-lesson-7-footer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
