<?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>WP Marketing &#187; sub pages</title>
	<atom:link href="http://wpmarketing.org/tag/sub-pages/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpmarketing.org</link>
	<description>Wordpress for Internet and Affiliate Marketing</description>
	<lastBuildDate>Wed, 09 Jun 2010 01:53:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hana Code Insert Example 1: List of sub pages or sub categories</title>
		<link>http://wpmarketing.org/2009/10/hana-code-insert-example-1-list-of-sub-pages-or-sub-categories/</link>
		<comments>http://wpmarketing.org/2009/10/hana-code-insert-example-1-list-of-sub-pages-or-sub-categories/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 12:36:31 +0000</pubDate>
		<dc:creator>HanaDaddy</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[code snippet]]></category>
		<category><![CDATA[Hana Code Insert]]></category>
		<category><![CDATA[sub categories]]></category>
		<category><![CDATA[sub pages]]></category>

		<guid isPermaLink="false">http://wpmarketing.org/2009/10/hana-code-insert-example-1-list-of-sub-pages-or-sub-categories/</guid>
		<description><![CDATA[Hello, this is HanaDaddy and I would like to show you how to quickly add some quick sub categories or sub pages within a page or a post. For all of you that do not know what Hana Code Insert Plugin is, it&#8217;s a simple plugin that enables you to add piece of codes (HTML, [...]


Related posts:<ol><li><a href='http://wpmarketing.org/2009/10/hana-code-insert-v2-2/' rel='bookmark' title='Permanent Link: Hana Code Insert v2.2'>Hana Code Insert v2.2</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Hello, this is HanaDaddy and I would like to show you how to quickly add some quick sub categories or sub pages within a page or a post. For all of you that do not know what Hana Code Insert Plugin is, it&#8217;s a simple plugin that enables you to add piece of codes (HTML, Javascript, or even PHP) in the middle of post or page. You can use it to add AdSense, Paypal donation button, HTLM forms, Analytics, or anything.</p>
<p>First, you need to install <a href="http://wpmarketing.org/plugins/hana-code-insert/">Hana Code Insert Plugin</a>.</p>
<p>Once you installed and activated the plugin, visit the Settings =&gt; Hana Code Insert option page. Activate the &#8216;Enable PHP Execution &#8216; check box. You need to enable this checkbox to use PHP. Then create an entry by inserting below code This is to show sub page of the current post.</p>
<p>You should not define &lt;?php or ?&gt; and need to enable ‘Evaluate as php code’ when you create the code entry. Please refer to below image for more info.</p>
<p><a href="http://wpmarketing.org/wp-content/uploads/2009/10/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://wpmarketing.org/wp-content/uploads/2009/10/image_thumb.png" border="0" alt="image" width="544" height="154" /></a><br />
<span id="more-276"></span><br />
This function will allow to show the list sub pages. Please note that $post variable has to be defined with ‘global’ modifier. The current post’s ID number is used as one of the function argument.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$children</span> <span style="color: #339933;">=</span> wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;child_of='</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;echo=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$children</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;<span style="color: #006699; font-weight: bold;">$children</span>&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now once you created the code entry, insert the hana code short code in the parent page.</p>
<p><a href="http://wpmarketing.org/wp-content/uploads/2009/10/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://wpmarketing.org/wp-content/uploads/2009/10/image_thumb1.png" border="0" alt="image" width="544" height="170" /></a></p>
<p>Then click on the Hana Code Button to insert the code that we just created.</p>
<p><a href="http://wpmarketing.org/wp-content/uploads/2009/10/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://wpmarketing.org/wp-content/uploads/2009/10/image_thumb2.png" border="0" alt="image" width="544" height="242" /></a></p>
<p><a href="http://wpmarketing.org/wp-content/uploads/2009/10/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://wpmarketing.org/wp-content/uploads/2009/10/image_thumb3.png" border="0" alt="image" width="544" height="177" /></a></p>
<p>This is the output.</p>
<p><a href="http://wpmarketing.org/wp-content/uploads/2009/10/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://wpmarketing.org/wp-content/uploads/2009/10/image_thumb4.png" border="0" alt="image" width="544" height="216" /></a></p>
<p>Just like this, you can show the list of categories or sub categories within a post or page.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Shows full list categories except 10.</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
wp_list_categories<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'orderby=name&amp;show_count=1&amp;exclude=10'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Shows the child categories of category 8.</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
wp_list_categories<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'orderby=id&amp;show_count=1&amp;use_desc_for_title=0&amp;child_of=8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Category ID or Page ID can be found by inspecting the URL of category or page edit links.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://wpmarketing.org/wp-content/uploads/2009/10/image5.png" border="0" alt="image" width="392" height="44" /></p>
<p>For more informaiton, here are the wordpress reference pages for wp_list_pages and wp_list_categories function.<br />
<a href="http://codex.wordpress.org/wp_list_pages">http://codex.wordpress.org/wp_list_pages</a><br />
<a href="http://codex.wordpress.org/Template_Tags/wp_list_categories">http://codex.wordpress.org/Template_Tags/wp_list_categories</a></p>
<p></p>
<p style='font-size:1.6em'><a href='http://wpmarketing.org/forum/forum/wp-plugin-hana-code-insert'>Hana Code Insert Forum</a></p>


<p>Related posts:<ol><li><a href='http://wpmarketing.org/2009/10/hana-code-insert-v2-2/' rel='bookmark' title='Permanent Link: Hana Code Insert v2.2'>Hana Code Insert v2.2</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://wpmarketing.org/2009/10/hana-code-insert-example-1-list-of-sub-pages-or-sub-categories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
