<?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>The WordPress Evangelist &#187; How-To</title>
	<atom:link href="http://wp-evangelist.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp-evangelist.com</link>
	<description>Spreading the good news about WordPress</description>
	<lastBuildDate>Mon, 18 Jul 2011 07:16:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Related posts with thumbnail</title>
		<link>http://wp-evangelist.com/2011/01/related-posts-with-thumbnail/</link>
		<comments>http://wp-evangelist.com/2011/01/related-posts-with-thumbnail/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 13:33:02 +0000</pubDate>
		<dc:creator>Blogie</dc:creator>
				<category><![CDATA[Extending WordPress]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[featured plugins]]></category>
		<category><![CDATA[related posts]]></category>
		<category><![CDATA[theme modification]]></category>
		<category><![CDATA[YARPP]]></category>

		<guid isPermaLink="false">http://wp-evangelist.com/?p=118</guid>
		<description><![CDATA[This is for those of you WordPressers who use YARPP (a.k.a. Yet Another Related Posts Plugin) and any of the excellent themes by WooThemes for your blogs. Especially if you&#8217;d like to spice up the plugin&#8217;s output a bit. I use YARPP on almost all of my WordPress sites, and I&#8217;ve started tweaking the plugin&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>This is for those of you WordPressers who use <a href="http://mitcho.com/code/yarpp/" class="extlink" target="_blank">YARPP</a> (a.k.a. <em>Yet Another Related Posts Plugin</em>) and any of the excellent themes by <a href="http://www.woothemes.com/amember/go.php?r=6094" class="extlink" target="_blank">WooThemes</a> for your blogs. Especially if you&#8217;d like to spice up the plugin&#8217;s output a bit.</p>
<p>I use YARPP on almost all of my WordPress sites, and I&#8217;ve started tweaking the plugin&#8217;s output, inspired by another related-posts plugin that I saw on <a href="http://www.davaobase.com">DavaoBase</a> recently. That other plugin is called <a href="http://www.linkwithin.com/learn" class="extlink" target="_blank" rel="nofollow">LinkWithin</a>, and I like how it displays related posts with thumbnails. However, this plugin has almost no options, unlike YARPP, which has tons of it! (And I&#8217;m suspicious of LinkWithin&#8217;s way of inserting redirects &#8212; it&#8217;s as if, for whatever reason, they&#8217;re out to track the clicks&#8230;)</p>
<div id="attachment_120" class="wp-caption alignleft" style="width: 183px"><a href="http://wp-evangelist.com/2011/01/related-posts-with-thumbnail/scrncap_dvodeli-post/" rel="attachment wp-att-120"><img src="http://wp-evangelist.com/images/2011/01/scrncap_dvodeli-post-173x200.jpg" alt="DavaoDeli.com screenshot" title="DavaoDeli.com post screenshot" width="173" height="200" class="size-thumbnail wp-image-120" /></a><p class="wp-caption-text">DavaoDeli.com screenshot</p></div>
<p>So, here&#8217;s something I&#8217;d like to share with those of you who&#8217;d like to keep using YARPP and display a thumbnail for every related post displayed on your blog posts. The screenshot here shows a post from my <a href="http://www.davaodeli.com/">food blog</a> &#8212; take a look at the bottom part (in the red square) with the &#8220;<span style="font-style:italic; font-family:Georgia,serif; color:#71B153;">You might also like&#8230;</span>&#8221; heading.</p>
<p>YARPP has a set of sample templates that let you control the visual output of the plugin. Instead of settling for the default settings, you can have a higher degree of control over how the related posts are displayed by using the YARPP templates. Simply copy one of those templates (located in <code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates</code>) into your current theme&#8217;s directory, modify that template to your heart&#8217;s desire, then activate it via the YARPP settings page.</p>
<h4>The custom YARPP template</h4>
<p>Create a template file in your theme directory that will contain the related-posts code. For our purposes, let&#8217;s name this file <code>yarpp-template-thumbs.php</code> (N.B., for YARPP to recognize the template, it has to be prepended by &#8220;yarpp-template-&#8221;). The code I wrote for DavaoDeli.com is the following:</p>
<pre>
&lt;?php /*
YARPP Template for use with post thumbnails
Requires WordPress 2.9+ and the WooThemes framework
Author: Blogie
*/ ?&gt;

&lt;?php if ($related_query-&gt;have_posts()) : ?&gt;

&lt;div class=&quot;relthumbs&quot;&gt;
	&lt;h5 class=&quot;relposts&quot;&gt;You might also like...&lt;/h5&gt;
	&lt;ul class=&quot;relposts-thumbs&quot;&gt;

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

		&lt;li class=&quot;relitem&quot;&gt;
			&lt;?php woo_image(&#039;key=image&amp;width=80&amp;height=80&amp;class=relimg&#039;); ?&gt;
			&lt;span class=&quot;thumb-ttl&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;
		&lt;/li&gt;

	&lt;?php endwhile; ?&gt;
	&lt;/ul&gt;
&lt;/div&gt;

&lt;?php else: ?&gt;

	&lt;p&gt;No related posts at the moment.&lt;/p&gt;

&lt;?php endif; ?&gt;
</pre>
<p>Line 7 above declares the start of the special WordPress Loop that calls the related posts (handled by the plugin). Line 16, on the other hand, is the one that displays the thumbnails. It&#8217;s a built-in function in all WooThemes.com themes with WooFramework version 3+.</p>
<div id="attachment_121" class="wp-caption alignright" style="width: 210px"><a href="http://wp-evangelist.com/2011/01/related-posts-with-thumbnail/scrncap_yarpp-settings/" rel="attachment wp-att-121"><img src="http://wp-evangelist.com/images/2011/01/scrncap_yarpp-settings-200x126.jpg" alt="YARPP settings" title="YARPP settings" width="200" height="126" class="size-thumbnail wp-image-121" /></a><p class="wp-caption-text">YARPP settings</p></div>
<p>For those of you who don&#8217;t use WooThemes, don&#8217;t despair. There is a YARPP template included with the plugin that you can use. It&#8217;s called <code>yarpp-template-thumbnail.php</code>. Just copy that template to your current theme directory, activate the template via the YARPP settings page, and make sure to follow the instructions contained in <a href="http://codex.wordpress.org/Function_Reference/has_post_thumbnail" class="extlink" target="_blank">this page</a> from the WP Codex.</p>
<p>(If you&#8217;re using a child theme, place the thumbnail-related WordPress functions in the child theme&#8217;s <code>functions.php</code> template.)</p>
<p>That&#8217;s it! I hope you&#8217;ve found this useful. <img src='http://wp-evangelist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wp-evangelist.com/2011/01/related-posts-with-thumbnail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Working with custom taxonomies</title>
		<link>http://wp-evangelist.com/2010/12/working-with-custom-taxonomies/</link>
		<comments>http://wp-evangelist.com/2010/12/working-with-custom-taxonomies/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 19:41:14 +0000</pubDate>
		<dc:creator>Blogie</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[ClassiPress]]></category>
		<category><![CDATA[custom category]]></category>
		<category><![CDATA[custom taxonomy]]></category>

		<guid isPermaLink="false">http://wp-evangelist.com/?p=109</guid>
		<description><![CDATA[Looking around in the WP codex, it dawned on me that there&#8217;s not much yet that&#8217;s been documented about how WordPress lets us manipulate custom taxonomies. Since WP2.3, we&#8217;ve been able to create custom post types, which can have their own custom categories and custom tags. The beauty of this is that, you can divide [...]]]></description>
			<content:encoded><![CDATA[<p>Looking around in the WP codex, it dawned on me that there&#8217;s not much yet that&#8217;s been documented about how WordPress lets us manipulate <a href="http://codex.wordpress.org/Custom_Taxonomies" class="extlink" target="_blank" title="view definition">custom taxonomies</a>. Since WP2.3, we&#8217;ve been able to create custom post types, which can have their own custom categories and custom tags. The beauty of this is that, you can divide your content into regular posts (and use them exclusively for blogging) and specialized posts that are meant for non-blog stuff.</p>
<p>For example, I&#8217;m working on a classified-ads site and the premium theme package I&#8217;ve chosen makes use of custom post types. It&#8217;s a wonderful theme (<a href="http://appthemes.com/cp/go.php?r=3136&#038;i=l1" rel="nofollow" class="extlink" target="_blank">ClassiPress</a>) and I love it. Classified ads appear in their own custom posts called ad listings, and are posted under ad categories. The screenshot of the site&#8217;s dashboard (<em>see image</em>) shows an extra menu item that says &#8220;Ads&#8221;. <a href="http://wp-evangelist.com/2010/12/working-with-custom-taxonomies/scrncap_dabiz-dashboard/" rel="attachment wp-att-110"><img src="http://wp-evangelist.com/images/2010/12/scrncap_dabiz-dashboard-150x142.png" alt="Dabawenyo.biz dashboard" title="Dabawenyo.biz dashboard" width="150" height="142" class="alignleft size-thumbnail wp-image-110" /></a> The ad listings, their categories and tags are accessible under this menu.</p>
<p>The ClassiPress theme (made by Appthemes.com) has lots of cool built-in features, too, such as a way for ad posters &#8212; people who submit ads to the site &#8212; to mark for-sale items as &#8220;sold&#8221;. And, when ads are marked thus, the ad page would have a &#8220;sold&#8221; tag prominently displayed on it. Problem is, I&#8217;ve put in other classified-ads sections in the mix: <em>For Hire</em>, <em>For Rent</em> and <em>Personals</em>. It wouldn&#8217;t be a good idea to have, say, a caterer&#8217;s services advertised under the <em>For Hire</em> section to be marked as &#8220;sold&#8221;, would it?</p>
<div class="woo-sc-box tick   ">The challenge was to customize the theme&#8217;s functions so that only ads posted under the <em>For Sale</em> section (or under its sub-categories) would be able to have the &#8220;sold&#8221; tag. I thought WP&#8217;s native <code>in_category()</code> and related functions would be enough. Wrong. That particular function only works with the default taxonomy system (ie., regular categories and link categories). So, I&#8217;d like to share here how I solved it.</div>
<p>The next page shows how I did it.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp-evangelist.com/2010/12/working-with-custom-taxonomies/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pagination in posts</title>
		<link>http://wp-evangelist.com/2010/07/posts-pagination/</link>
		<comments>http://wp-evangelist.com/2010/07/posts-pagination/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 02:00:38 +0000</pubDate>
		<dc:creator>Blogie</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[template tags]]></category>

		<guid isPermaLink="false">http://wp-evangelist.com/?p=85</guid>
		<description><![CDATA[I got an inquiry from one of my blog&#8217;s readers about post pagination, which I used in my previous post. Well, it&#8217;s very simple. To split your post into separate sub-pages, simply use the WordPress Quicktag, &#60;!--nextpage--&#62;. Remember the &#60;!--more--&#62; tag? It cuts the post where it&#8217;s placed when the post appears in the blog&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I got an inquiry from one of my blog&#8217;s readers about <em>post pagination</em>, which I used in my <a href="http://wp-evangelist.com/2010/07/mobile-wordpress-wptouch/" rel="bookmark">previous post</a>. Well, it&#8217;s very simple. To split your post into separate sub-pages, simply use the WordPress <em>Quicktag</em>, <strong><code>&lt;!--nextpage--&gt;</code></strong>.</p>
<p>Remember the  <code>&lt;!--more--&gt;</code> tag? It cuts the post where it&#8217;s placed when the post appears in the blog&#8217;s front page. The <code>&lt;!--nextpage--&gt;</code> tag, on the other hand, works as a &#8216;paginator&#8217; for single posts, and divides them into sub-pages where they&#8217;re placed. You can have as many pages as you like (but don&#8217;t over do it).</p>
<p>For example (use the HTML view when inserting the quicktag):</p>
<pre>
&lt;h3&gt;Step #5&lt;/h3&gt;
Consectetuer rutrum urna in, a molestie aliquam gravida, quam vestibulum ac. Consequat ut lacus tempus a ipsum, sociis urna sed, vel tellus maecenas, lorem maecena&#039;s tortor. At odio platea etiam. &lt;strong&gt;Euismod libero&lt;/strong&gt; pretium accumsan pellentesque ac. Quam semper in vitae dictum eget, ipsum magna orci odio lectus. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit.

Please see the next page for the last 3 steps.
&lt; !--nextpage--&gt;
&lt;h4&gt;Step #6&lt;/h3&gt;
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, &lt;em&gt;totam rem aperiam&lt;/em&gt;, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
</pre>
<p>As you might have seen in my last post:</p>
<p><img src="http://wp-evangelist.com/images/2010/07/scrncap_pagination-550x372.png" alt="Screenshot: pagination" title="Screenshot: pagination" width="550" height="372" class="alignnone size-medium wp-image-86" /></p>
<p>And we can even do it right now! <em>(Make sure to click on Page 2)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://wp-evangelist.com/2010/07/posts-pagination/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Shortlinks for posts</title>
		<link>http://wp-evangelist.com/2010/07/wordpress-shortlinks/</link>
		<comments>http://wp-evangelist.com/2010/07/wordpress-shortlinks/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 13:17:42 +0000</pubDate>
		<dc:creator>Blogie</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[template tags]]></category>
		<category><![CDATA[URL shortener]]></category>
		<category><![CDATA[wp.me]]></category>

		<guid isPermaLink="false">http://wp-evangelist.com/?p=60</guid>
		<description><![CDATA[Since WordPress 3.0 was launched, I&#8217;m sure you&#8217;ve noticed the Get Shortlink button below the post title input field in the Add New / Edit Post screen, beside the post&#8217;s permalink. (See image below.) It&#8217;s a nifty feature made available to us by good old WordPress.org for shortening our posts&#8217; URLs. Clicking on it will [...]]]></description>
			<content:encoded><![CDATA[<p>Since WordPress 3.0 was launched, I&#8217;m sure you&#8217;ve noticed the <strong>Get Shortlink</strong> button below the post title input field in the <em>Add New / Edit Post</em> screen, beside the post&#8217;s permalink. <em>(See image below.)</em> It&#8217;s a nifty feature made available to us by good old WordPress.org for shortening our posts&#8217; URLs. Clicking on it will give you a <strong>wp.me</strong> URL which will redirect to your blog post. (This post&#8217;s shortlink, for example, is <em><a href="http://wp.me/pqxl6-Y" rel="nofollow">http://wp.me/pqxl6-Y</a></em>.)</p>
<p>If you promote your blog posts via <a href="http://twitter.com/blogie" rel="nofollow">Twitter</a> or <a href="http://www.plurk.com/blogie" rel="nofollow">Plurk</a>, you probably use a plugin for auto-posting to those online services. However, if you&#8217;re the type who wants to personalize your shout-outs that go with your blog post link &#8212; maybe so you can insert hashtags &#8212; you&#8217;d have to manually add the post URL yourself, don&#8217;t you? And if the URL&#8217;s too long, you&#8217;d have to use a URL shortener like bit.ly or tinyurl.com (or any of the scores of similar services), right?</p>
<p><img src="http://wp-evangelist.com/images/2010/07/scrncap_postscreen-shortlink-400x236.png" alt="Post screen: Get Shortlink" title="Post screen: Get Shortlink" width="400" height="236" class="alignleft size-medium wp-image-62" /></p>
<p>Not anymore. With <strong>wp.me</strong> shortlinks, your WordPress blog now has a built-in URL shortener! Don&#8217;t you just love WordPress!?!</p>
<p><em>But wait, there&#8217;s more!!</em> (Am I sounding like a TV salesman already? <img src='http://wp-evangelist.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )</p>
<p>What if you wanted to make the shortlink visible on the blog for everyone to see? That&#8217;s exactly what I did with my <a href="http://www.davaodeli.com">food blog</a>. See, sometimes I go back to old posts and promote them on Twitter and Facebook. Instead of having to go inside the dashboard and get the shortlink from the <em>Edit Post</em> screen, I can now just go to the blog post (or even the search results page) and copy the shortlink from under the title. Take a look at this screen shot of a couple of front-page posts from <span style="font-variant:small-caps;">Davao Delicious</span>:</p>
<p><a href="http://wp-evangelist.com/2010/07/wordpress-shortlinks/scrncap_dvodeli-front/" rel="attachment wp-att-61"><img src="http://wp-evangelist.com/images/2010/07/scrncap_dvodeli-front-400x245.png" alt="WordPress shortlinks" title="WordPress shortlinks @ DavaoDeli.com" width="400" height="245" class="alignleft size-medium wp-image-61" /></a></p>
<p>Notice the &#8220;[shortlink]&#8221; text below the titles? By using a WP template tag, I was able to output the shortlink of each post onto various locations of the blog: the main page, single posts, archives, and the search results page. (And my other blogs are sure to follow suit.)</p>
<p>Here&#8217;s how to do it. There is just one new template tag involved: <code>the_shortlink()</code>. This tag <em>must</em> be placed inside The Loop, otherwise it won&#8217;t work. And, according to the <a href="http://codex.wordpress.org/Function_Reference/the_shortlink" rel="nofollow" title="click to view the function reference" target="_blank" class="extlink">Codex</a>, it will only work on WordPress sites that implement <a href="http://wp-evangelist.com/2010/05/permalinks-and-seo/" rel="bookmark">pretty permalinks</a>.</p>
<pre>
&lt;?php the_shortlink( $text, $title, $before, $after ); ?&gt;
</pre>
<p>Here&#8217;s how my code looks like:</p>
<pre>
&lt;div class=&quot;post-title&quot;&gt;
	&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
	&lt;p class=&quot;post-details&quot;&gt;
		Posted on &lt;?php the_time(&#039;j F Y&#039;); ?&gt; by &lt;?php the_author_posts_link(); ?&gt;
		&lt;?php the_shortlink(&#039;shortlink&#039;,&#039;&#039;,&#039;[&#039;,&#039;]&#039;); ?&gt;
	&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>The first parameter, <code>$text</code>, can be any string that you&#8217;d like to be seen by your site&#8217;s visitors. The next parameter, <code>$title</code>, is for the tooltip text that will appear on mouse-over. If you leave it blank, the default is the post&#8217;s title. The last two, <code>$before</code> and <code>$after</code> are for HTML codes and/or more text that you&#8217;d like to appear before and after the shortlink.</p>
<p>All of the parameters are optional. However, leaving the first one blank will result in this text link: &#8220;<em>This is the short link.</em>&#8221; Kinda fugly if you ask me, so it might be best to supply your own expression.</p>
<p>That&#8217;s it! Have fun with the WordPress URL shortener!</p>
<p><em>N.B.</em>: Each post (and page, including the front page) actually has an assigned <strong>wp.me</strong> URL. If you view the page source, you&#8217;ll see the shortlink in the header. That is, if you&#8217;ve activated the WordPress.com Stats plugin and specified that the shortlink be published as meta data.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp-evangelist.com/2010/07/wordpress-shortlinks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Oyako themes</title>
		<link>http://wp-evangelist.com/2010/07/oyako-themes/</link>
		<comments>http://wp-evangelist.com/2010/07/oyako-themes/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 08:29:39 +0000</pubDate>
		<dc:creator>Blogie</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[child themes]]></category>
		<category><![CDATA[theme modification]]></category>

		<guid isPermaLink="false">http://wp-evangelist.com/?p=58</guid>
		<description><![CDATA[Oyako (親子) is a Japanese term that means &#8220;parent-child&#8221;. In Japanese cuisine there&#8217;s a tasty dish I like that&#8217;s called oyako-don, which is a bowl of rice toppings of chicken and egg. And why am I talking about this? WordPress&#8217; child themes! Ever got tired of copying over the changes you&#8217;ve made to your templates [...]]]></description>
			<content:encoded><![CDATA[<p><em>Oyako</em> (親子) is a Japanese term that means &#8220;parent-child&#8221;. In Japanese cuisine there&#8217;s a tasty dish I like that&#8217;s called <em>oyako-don</em>, which is a bowl of rice toppings of chicken and egg. And why am I talking about this? WordPress&#8217; <strong>child themes</strong>!</p>
<p>Ever got tired of copying over the changes you&#8217;ve made to your templates each time your theme is upgraded? Ever lost template changes after upgrading your WordPress theme? Well don&#8217; fret, because here&#8217;s something that I&#8217;m sure you&#8217;ll find heaven-sent.</p>
<p>Child themes have existed since WordPress 2.7 (but I&#8217;ve only now gotten around to tinkering with it), and it&#8217;s the best way to go about modifying &#8212; and keeping the changes to &#8212; your themes&#8217; templates.</p>
<p>I&#8217;ve started using child themes in some of my blogs. Take a look at the screenshot of Blogie Blog&#8217;s dashboard, showing the child theme:</p>
<p><a href="http://wp-evangelist.com/2010/07/oyako-themes/scrncap-blogieblog-themes/" rel="attachment wp-att-59"><img src="http://wp-evangelist.com/images/2010/07/scrncap-blogieblog-themes-127x150.png" alt="Blogie Blog child theme" title="Blogie Blog child theme" width="127" height="150" class="alignleft size-thumbnail wp-image-59" /></a></p>
<p>Basically, when you use child themes, you can create a separate theme (based on the parent theme) that will hold all your template modifications. So, when your theme provider publishes an update, you can update the parent theme and keep the changes you&#8217;ve made in the child theme.</p>
<p>Child themes inherit all the templates (<code>index.php</code>, <code>single.php</code>, etc.) from its parent &#8212; that is, those templates that you don&#8217;t override. One template that must be unique to the child theme, however, is <code>style.css</code>. That&#8217;s right: when you create a child theme, it must have its own stylesheet file.</p>
<p>If you&#8217;ve read the <a href="http://codex.wordpress.org/Child_Themes">Codex</a>, you&#8217;ll know that you&#8217;ll need to create a <code>style.css</code> file and that&#8217;s where you&#8217;ll place your own style declarations for your site. And, to include all the style declarations from the parent theme, you&#8217;ll need to import it into your new stylesheet file (using <code>@import</code>). This is all that&#8217;s required for you to have a child theme.</p>
<p>If you create a new <code>single.php</code> template for your child theme, it will override the parent theme&#8217;s template. This is useful for those templates that you want to modify to suit your needs. The templates that you don&#8217;t override will simply be inherited by the child theme. In fact, you&#8217;ll notice that the parent theme&#8217;s templates will appear in your child theme&#8217;s list of templates (<em>Appearance</em> &gt; <em>Editor</em>).</p>
<p>Some things to watch out for when using child themes&#8211;</p>
<p>When overriding templates (e.g., <code>header.php</code>), check to see if hyperlink calls are properly formatted. Some theme designers use the WordPress function <code>&lt;?php bloginfo('template_directory'); ?&gt;</code> to call theme images or CSS files. For example:</p>
<pre>
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;?php bloginfo(&#039;template_directory&#039;); ?&gt;/css/ie7.css&quot; media=&quot;screen&quot; /&gt;
</pre>
<p>On this blog, the above code will resolve to the following:</p>
<pre>
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://wp-evangelist.com/wp-content/themes/antisocial/css/ie6.css&quot; media=&quot;screen&quot; /&gt;
</pre>
<p>Please take very careful note of this:  Even if the above sample code is placed in a <em>child theme</em> template, the <code>&lt;?php bloginfo('template_directory'); ?&gt;</code> function <strong>will still return the URL of the parent theme</strong>. On the other hand, the WordPress function <code>&lt;?php bloginfo('stylesheet_url'); ?&gt;</code> will always return the URL of the style.css template of the <em>active theme</em>. So, if you have a piece of code like below placed in a child theme&#8217;s template, the latter function will most certainly return the URL of the child theme&#8217;s <code>style.css</code> file.</p>
<pre>
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;?php bloginfo(&#039;stylesheet_url&#039;); ?&gt;&quot; media=&quot;screen&quot; /&gt;
</pre>
<p>Child themes don&#8217;t seem to see below its parent theme&#8217;s directory. I use WooThemes&#8217; excellent themes, and their theme files (PHP templates, CSS files, images, JS files) are organized in sub-folders. All the main PHP templates (<code>index.php</code>, <code>page.php</code>, <code>archive.php</code>, etc.) are in the root directory of the theme, but most of the support files are placed in sub-folders. It seems that the files in those sub-folders are not accessible to child themes&#8230; You see, I tried to override some of the templates existing in the parent theme&#8217;s sub-folder by recreating those templates and sub-folders under the child theme&#8217;s own directory. No go.</p>
<p>Solution: change the hyperlinks calling those templates (or images, etc.) to reflect the actual locations.</p>
<p>So far, I&#8217;ve only been experimenting with the fundamentals of WordPress child themes. I know there&#8217;s a lot more to it, especially in the <code>functions.php</code> arena. To get you started on that, do read <a href="http://themeshaper.com/modify-wordpress-themes/" rel="nofollow" class="extlink" target="_blank">this article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp-evangelist.com/2010/07/oyako-themes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WP3.0: multi-site enabled!</title>
		<link>http://wp-evangelist.com/2010/05/wp30-multisite-enabled/</link>
		<comments>http://wp-evangelist.com/2010/05/wp30-multisite-enabled/#comments</comments>
		<pubDate>Mon, 17 May 2010 04:03:16 +0000</pubDate>
		<dc:creator>Blogie</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Apache configuration]]></category>
		<category><![CDATA[DNS configuration]]></category>
		<category><![CDATA[multi-site functionality]]></category>
		<category><![CDATA[WordPress 3.0]]></category>

		<guid isPermaLink="false">http://wp-evangelist.com/?p=44</guid>
		<description><![CDATA[WordPress 3.0 is set to be released this month, and I can&#8217;t tell you how very excited I am to get my hands on it. I do have the beta2 version, and I&#8217;ve been playing around with it. There are quite a few new stuff you can expect from WP3.0, but the most significant update [...]]]></description>
			<content:encoded><![CDATA[<p><strong>WordPress 3.0</strong> is set to be released this month, and I can&#8217;t tell you how very excited I am to get my hands on it. I do have the beta2 version, and I&#8217;ve been playing around with it. There are quite a few new stuff you can expect from WP3.0, but the most significant update (in my view) is its multi-site functionality. Read: WordPress and WordPress MU are now being merged.</p>
<p>For the benefit of those who are as yet unaware, <strong>WordPress &mu;</strong> (MU or &#8220;multi-user&#8221;) is a branch of WordPress that lets super administrators create a network of blogs in one installation. This is, in fact, what powers <a href="http://wordpress.com" target="_blank" class="extlink" rel="nofollow">wordpress.com</a> blogs.</p>
<p>I&#8217;ve finally gotten the multi-site (or multi-user) functionality of WordPress 3.0 beta2! And I&#8217;d like to share how I did it. You may choose not to use this functionality and use WordPress 3.0 as a single-site blog, but if you do want this awesome feature, do read on!</p>
<p>Here are the salient details of my WordPress environment:</p>
<table width="80%" cellpadding="6">
<tr>
<td>CentOS server</td>
<td>Apache version 2.2+</td>
</tr>
<tr>
<td>PHP version 5.2+</td>
<td>MySQL version 5.0+</td>
</tr>
<tr>
<td>PHP safe mode off</td>
<td>Running suPHP</td>
</tr>
</table>
<p>Before installing WordPress, you need to add this entry to your chosen domain name&#8217;s DNS table: <code>*.domain.tld. 1400 in A {IP address}</code>. Let&#8217;s assume your domain name is <em>myblognet.ph</em>, and the IP address that your web host has assigned you is <em>222.111.2.3</em>. If you don&#8217;t have access to DNS, ask your host to do this part for you. The entry should look something like this:</p>
<pre>
*.myblognet.ph. 1400 in A 222.111.2.3
</pre>
<p>Then, you&#8217;ll need to change some stuff in your Apache configuration. Please be careful with this and triple-check your work at each step, to ensure you won&#8217;t accidentally mess things up. You&#8217;ll need to access the <code>httpd.conf</code> file (in my setup, this file is located in <code>/usr/local/apache/conf/</code>), and update the <code>VirtualHost</code> section containing the domain name you&#8217;re using for WP3.0. To wit (highlit lines):</p>
<pre>
&lt;VirtualHost 222.111.2.3:80&gt;
    ServerName myblognet.ph
    ServerAlias *.myblognet.ph
    ServerAlias www.*.myblognet.ph
    # more code here...
    # no need to edit them!
&lt;/VirtualHost&gt;
</pre>
<p>You should then execute the following command (via SSH) so that the <code>VirtualHost</code> changes you made will take effect.</p>
<pre>
>> /usr/local/cpanel/bin/apache_conf_distiller --update
</pre>
<p>Your hosting environment may be different, so if you&#8217;re doing this on your own, please ask your host about the command above. Tip: use the <code>locate</code> command in SSH to find files and executables; e.g., <code>locate httpd.conf</code>.</p>
<p>Then, execute the following to restart your Web server.</p>
<pre>
>> /etc/init.d/httpd restart
</pre>
<p>Now, go ahead and install WordPress. Upon successful installation, add the following directive to your <code>wp-config.php</code> file. It would be a good idea to place this line (#83 below) just above the part that says <code>/* That's all, ... */</code></p>
<pre>
define('WP_ALLOW_MULTISITE', true);

/* That's all, stop editing! Happy blogging. */
</pre>
<p>Login to your dashboard and click on <em>Tools &raquo; Network</em>. The next screen will guide you through some more setup instructions, particularly for your <code>wp-config.php</code> and <code>.htaccess</code> files. Make sure to choose the <em>sub-domain functionality</em>, to be able to give your users a sub-domained site, such as <code>http://pokerclub.myblognet.ph</code>.</p>
<p>Once that&#8217;s done, you will notice a new menu item above the home icon: the <em>Super Admin</em>. And <em>voil&aacute;</em>, you now have a working multi-site WordPress installation! Go ahead and test it by creating new sites.</p>
<p>If you have questions, please feel free to drop a line below.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp-evangelist.com/2010/05/wp30-multisite-enabled/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

