<?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 Guru &#187; Navigation</title>
	<atom:link href="http://wpguru.co.za/category/navigation/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpguru.co.za</link>
	<description>Tips &#38; Pointers on Making a Killer CMS with WordPress</description>
	<lastBuildDate>Tue, 04 May 2010 08:43:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Easy WordPress Breadcrumbs</title>
		<link>http://wpguru.co.za/navigation/easy-wordpress-breadcrumbs/</link>
		<comments>http://wpguru.co.za/navigation/easy-wordpress-breadcrumbs/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 13:22:40 +0000</pubDate>
		<dc:creator>MarkB</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[breadcrumb]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://wpguru.co.za/?p=121</guid>
		<description><![CDATA[Your site should always be as usable as possible and site navigation is a big part of that. Aside from your standard sidebars and top navigation, it's always a good idea to include a breadcrumb to let users track their way back to the home page.]]></description>
			<content:encoded><![CDATA[<div id="attachment_127" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-127" title="WordPress Breadcrumbs" src="http://wpguru.co.za/wp-content/uploads/breadcrumb-300x288.jpg" alt="" width="300" height="288" /><p class="wp-caption-text">Image by PetitPlat by sk_</p></div>
<p>Your site should always be as usable as possible and site navigation is a big part of that. Aside from your standard sidebars and top navigation, it&#8217;s always a good idea to include a breadcrumb to let users track their way back to the home page. Of course there are lots of plugins you can use to insert this, but why use a plugin, when you can do it just as easily on your own.</p>
<p>Here&#8217;s the code that you&#8217;ll need to add to your functions.php file:</p>
<pre class="brush: php;">//breadcrumb function
function YLcrumbs() {
 if ((is_page() &amp;&amp; !is_front_page()) || is_home() || is_category() || is_single()) {
 echo '&lt;ul id=&quot;breadcrumbs&quot;&gt;';
 echo '&lt;li&gt;&lt;a href=&quot;'.get_bloginfo('url').'&quot;&gt;Home&lt;/a&gt;&amp;raquo;&lt;/li&gt;';
 $post_ancestors = get_post_ancestors($post);
 if ($post_ancestors) {
 $post_ancestors = array_reverse($post_ancestors);
 foreach ($post_ancestors as $crumb)
 echo '&lt;li&gt;&lt;a href=&quot;'.get_permalink($crumb).'&quot;&gt;'.get_the_title($crumb).'&lt;/a&gt;&amp;raquo;&lt;/li&gt;';
 }
 if (is_category() || is_single()) {
 $category = get_the_category();
 echo '&lt;li&gt;&lt;a href=&quot;'.get_category_link($category[0]-&gt;cat_ID).'&quot;&gt;'.$category[0]-&gt;cat_name.'&lt;/a&gt;&amp;raquo;&lt;/li&gt;';
 }
 if (!is_category())
 echo '&lt;li&gt;&lt;a href=&quot;'.get_permalink().'&quot;&gt;'.get_the_title().'&lt;/a&gt;&lt;/li&gt;';
 echo '&lt;/ul&gt;';
 }
}</pre>
<p>Then, in your template, wherever you want to display your breadcrumb, you&#8217;d add the following:</p>
<pre class="brush: php;">&lt;? YLcrumbs(); ?&gt;</pre>
<p>Note that the function generates a breadcrumb in a UL element, so your CSS might look something like this:</p>
<pre class="brush: css;">#breadcrumbs {padding: 10px 0;margin:0;}
#breadcrumbs li {display:inline;padding: 0 10px 0 0;}</pre>
<p>That would give you a  list of LI elements in a row. Then you can style it up further as you require.</p>
<p>Have you used this somewhere? Leave a link in the comments to your implementation of this breadcrumb system.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.za/navigation/easy-wordpress-breadcrumbs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make your own WordPress drop down menu</title>
		<link>http://wpguru.co.za/navigation/make-your-own-wordpress-drop-down-menu/</link>
		<comments>http://wpguru.co.za/navigation/make-your-own-wordpress-drop-down-menu/#comments</comments>
		<pubDate>Wed, 07 May 2008 10:18:22 +0000</pubDate>
		<dc:creator>MarkB</dc:creator>
				<category><![CDATA[Navigation]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[drop down]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://wpguru.co.za/?p=59</guid>
		<description><![CDATA[When it comes to creating a site that has multi-level navigation, a drop down menu is often your best means of keeping the navigation simple and uncluttered. There are a few plugins that you can use to achieve this, but I've found that many of them make too many assumptions and don't work exactly how I'd like them too. For that reason, I'll detail a simple means of making your own WordPress drop down menu.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-159" title="menu" src="http://wpguru.co.za/wp-content/uploads/menu1-300x199.jpg" alt="" width="300" height="199" />When it comes to creating a site that has multi-level navigation, a drop down menu is often your best means of keeping the navigation simple and uncluttered. There are a few plugins that you can use to achieve this, but I’ve found that many of them make too many assumptions and don’t work exactly how I’d like them too. For that reason, I’ll detail a simple means of making your own WordPress drop down menu.</p>
<p>Here’s a demo of what we’re going to accomplish. (Tested in IE7 &amp; FF)</p>
<h3>Getting started</h3>
<p>Firstly, you’ll need to setup your pages in WordPress in a hierarchal manner. IE:</p>
<ul>
<li>Home Page</li>
<li>About Us
<ul>
<li>What We Do</li>
<li>What We’ve Done</li>
<li>Who Works For Us</li>
</ul>
</li>
<li>Services</li>
<li>Portfolio
<ul>
<li>Our Clients</li>
</ul>
</li>
<li>Contact Us</li>
</ul>
<p>This will generate a nested UL LI list in your code.</p>
<pre class="brush: xml;">&lt;ul id=&quot;nav&quot;&gt;
	&lt;li&gt;&lt;a href= &quot;#&quot;&gt;Home Page&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href= &quot;#&quot;&gt;About Us&lt;/a&gt;
		&lt;ul id=&quot;aboutus&quot;&gt;
			&lt;li&gt;&lt;a href= &quot;#&quot;&gt;What We Do&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href= &quot;#&quot;&gt;What We've Done&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href= &quot;#&quot;&gt;Who Works For Us&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href= &quot;#&quot;&gt;Services&lt;/a&gt;
		&lt;ul id=&quot;services&quot;&gt;
			&lt;li&gt;&lt;a href= &quot;#&quot;&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href= &quot;#&quot;&gt;Our Clients&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href= &quot;#&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Sorted? <img src='http://wpguru.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Making it dynamic</h3>
<p>What you’re going to do now, is break that list down somewhat and create your own navigation. The top level menu items will be static, and their subpages will be dynamic. Like so:</p>
<pre class="brush: php;">&lt;ul id=&quot;nav&quot;&gt;
	&lt;? wp_list_pages('title_li=&amp;sort_column=menu_order'); ?&gt;
&lt;/ul&gt;</pre>
<p>You might also want to include a home link. You can add this manually like so:</p>
<pre class="brush: php;">&lt;ul id=&quot;nav&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;&lt;? bloginfo('siteurl'); ?&gt;&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;? wp_list_pages('title_li=&amp;sort_column=menu_order'); ?&gt;
&lt;/ul&gt;</pre>
<h3>The Script</h3>
<p>There’s a tiny piece of jQuery required to show/hide the drop down menu’s. From an accessibility point of view, you can link the top level navigation item so that if JS is disabled, the user will still be able to get around your site. Here’s the script.</p>
<pre class="brush: jscript;">
$(document).ready(function() {
	$(&quot;#nav ul&quot;).css({display: &quot;none&quot;}); // Opera Fix
	$(&quot;#nav li&quot;).hover(function(){
	$(this).find('ul:first').css({visibility: &quot;visible&quot;,display: &quot;none&quot;}).show(); },function(){ $(this).find('ul:first').css({visibility: &quot;hidden&quot;}); });
});
</pre>
<h3>The CSS</h3>
<p>This CSS is really a guide and it largely depends on the styling of your site. The important thing is to add &#8220;position:relative;&#8221; to the first level of LI elements. The UL element (the drop down menu) needs to have &#8220;position:absolute;&#8221; so the parent LI needs to be relatively positioned to your dropdown menu doesn&#8217;t display topleft corner of the page.</p>
<pre class="brush: css;">
/*navigation*/
#nav {padding:0;margin:0;}
#nav li {position:relative;display:block;float:left;}
#nav li a {display:block;float:left;height:30px;line-height:30px;padding: 0 20px;}

/*sub navigation*/
#nav ul {position:absolute;top: 30px;left:0;padding:0;} /*the top:30px command must be the same height as your parent LI so the dropdown displays below the main navigation*/
#nav ul a, #nav ul li {float:none;}
</pre>
<p>This is the CSS used to achieve the effect in the demo. You can of course change it to suit your site’s styles.</p>
<p>And presto, you’ll have a drop down menu. As you add sub pages in your WP admin, those pages will automatically be included in your drop down.</p>
<p>Slick <img src='http://wpguru.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.za/navigation/make-your-own-wordpress-drop-down-menu/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Creating a dynamic select menu</title>
		<link>http://wpguru.co.za/navigation/creating-a-dynamic-select-menu/</link>
		<comments>http://wpguru.co.za/navigation/creating-a-dynamic-select-menu/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 09:25:30 +0000</pubDate>
		<dc:creator>MarkB</dc:creator>
				<category><![CDATA[Navigation]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[select]]></category>

		<guid isPermaLink="false">http://wpguru.co.za/?p=45</guid>
		<description><![CDATA[I think more of an explanation is required on the title of this post to properly convey what we're going to accomplish here. We're going to setup 2 form selects. The 2nd select menu will be dynamically populated based on the selection made in the first drop down. Practically, lets say you want a user to choose from a list of main categories, and then use the second select to choose a sub category of the category chosen in the first select. Make sense? Cool.. here's how...]]></description>
			<content:encoded><![CDATA[<div id="attachment_145" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-145 " title="Menu" src="http://wpguru.co.za/wp-content/uploads/menu-300x199.jpg" alt="" width="300" height="199" /><p class="wp-caption-text">Image by: leunix</p></div>
<p>I think more of an explanation is required on the title of this post to properly convey what we&#8217;re going to accomplish here. We&#8217;re going to setup 2 form selects. The 2nd select menu will be dynamically populated based on the selection made in the first drop down. Practically, lets say you want a user to choose from a list of main categories, and then use the second select to choose a sub category of the category chosen in the first select. Make sense? Cool.. here&#8217;s how…</p>
<p>Here&#8217;s a demo of what we&#8217;re going to do.</p>
<p>Firstly, you need the form that will generate the select menu made up of main categories. In this case, I&#8217;ve chosen to manually create this list, but you can of course use a bit of creativity to generate this list dynamically too.</p>
<pre class="brush: php;">&lt;form method=&quot;post&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;phpMyAdmin&quot; value=&quot;01d7dd3a1764f33b9145cd20ad99db24&quot; /&gt;
 &lt;select name=&quot;country&quot; onchange=&quot;htmlData('&lt;? bloginfo('template_directory'); ?&gt;/city.php', 'ch='+this.value)&quot; /&gt;
 &lt;option value=&quot;#&quot;&gt;-Select-&lt;/option&gt;
 &lt;option value=&quot;Botswana&quot;&gt;Botswana&lt;/option&gt;
 &lt;option value=&quot;EasternCape&quot;&gt;Eastern Cape&lt;/option&gt;
 &lt;option value=&quot;FreeState&quot;&gt;Free State&lt;/option&gt;
 &lt;option value=&quot;GardenRoute&quot;&gt;Garden Route&lt;/option&gt;
 &lt;option value=&quot;Gauteng&quot;&gt;Gauteng&lt;/option&gt;
 &lt;option value=&quot;KwazuluNatal&quot;&gt;Kwazulu Natal&lt;/option&gt;
 &lt;option value=&quot;LimpopoProvince&quot;&gt;Limpopo Province&lt;/option&gt;
 &lt;option value=&quot;Mpumalanga&quot;&gt;Mpumalanga&lt;/option&gt;
 &lt;option value=&quot;Namibia&quot;&gt;Namibia&lt;/option&gt;
 &lt;option value=&quot;NorthWestProvince&quot;&gt;North West Province&lt;/option&gt;
 &lt;option value=&quot;NorthernCape&quot;&gt;Northern Cape&lt;/option&gt;
 &lt;option value=&quot;Other&quot;&gt;Other&lt;/option&gt;
 &lt;option value=&quot;WesternCape&quot;&gt;Western Cape&lt;/option&gt;
 &lt;/select&gt;</pre>
<p>You notice this:</p>
<pre class="brush: php;">&lt;select name=&quot;country&quot; onchange=&quot;htmlData('&lt;? bloginfo('template_directory'); ?&gt;/city.php', 'ch='+this.value)&quot; /&gt;</pre>
<p>You&#8217;ll now create a file called city.php (or whatever you like – just change the file name in the above select menu to the name of your file) and inside this file you&#8217;re going to have the menu&#8217;s that will be inserted into the second select menu depending on what is chosen in the first menu. We&#8217;ll get to the contents of this file in a second…</p>
<p>Right below the first form that has your main category select menu, you add the second form that contains the select that will be dynamically created. Note that the select menu in this form contains a wrapping div that is used in the Javascript to dynamically populate it.</p>
<pre class="brush: php;">&lt;form action=&quot;&lt;?php echo get_option('home'); ?&gt;/?cat=&quot; method=&quot;get&quot;&gt;
 &lt;div id=&quot;txtResult&quot;&gt; &lt;select name=&quot;cat&quot;&gt;&lt;option&gt;&lt;/option&gt;&lt;/select&gt; &lt;/div&gt;
 &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Search&quot; /&gt;
&lt;/form&gt;</pre>
<p>Ok, now you can populate your city.php file with the options for the second, dynamically populated select menu. My file looks like this:</p>
<pre class="brush: php;">&lt;? if ($_GET['ch'] == 'Botswana') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=33&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'EasternCape') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=24&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'FreeState') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=30&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'GardenRoute') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=25&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'Gauteng') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=26&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'KwazuluNatal') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=31&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'LimpopoProvince') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=28&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'Mpumalanga') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=27&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'Namibia') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=32&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'NorthWestProvince') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=29&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'NorthernCape') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=23&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'Other') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=114&amp;name=cat'); ?&gt;

&lt;? } if ($_GET['ch'] == 'WesternCape') { ?&gt;
&lt;?php wp_dropdown_categories('child_of=22&amp;name=cat'); ?&gt;

&lt;?php } ?&gt;</pre>
<p>For each of these entries, you should change the child_of value. Basically each of these commands is creating a select menu that contains the child categories of the category I choose in the first select menu.</p>
<p>Now your form content is ready. All thats left to do, is power it up with a bit of Javascript. Call this script in your header.</p>
<pre class="brush: jscript;">// select box
function GetXmlHttpObject(handler)
{
 var objXMLHttp=null
 if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
 else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;)
 }
 return objXMLHttp
}

function stateChanged()
{
 if (xmlHttp.readyState==4 || xmlHttp.readyState==&quot;complete&quot;)
 {
 document.getElementById(&quot;txtResult&quot;).innerHTML= xmlHttp.responseText;
 }
 else {
 //alert(xmlHttp.status);
 }
}

// Will populate data based on input
function htmlData(url, qStr)
{
 if (url.length==0)
 {
 document.getElementById(&quot;txtResult&quot;).innerHTML=&quot;&quot;;
 return;
 }
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
 alert (&quot;Browser does not support HTTP Request&quot;);
 return;
 }

 url=url+&quot;?&quot;+qStr;
 url=url+&quot;&amp;sid=&quot;+Math.random();
 xmlHttp.onreadystatechange=stateChanged;
 xmlHttp.open(&quot;GET&quot;,url,true) ;
 xmlHttp.send(null);
}</pre>
<p>And that&#8217;s that.</p>
<p>Tweak it all up to suit your category names and ID&#8217;s and you&#8217;ll be good to go. Let me know if you&#8217;ve implemented this and how it worked for you! <img src='http://wpguru.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.za/navigation/creating-a-dynamic-select-menu/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Displaying child pages of the current page</title>
		<link>http://wpguru.co.za/navigation/displaying-child-pages-of-the-current-page/</link>
		<comments>http://wpguru.co.za/navigation/displaying-child-pages-of-the-current-page/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 10:09:08 +0000</pubDate>
		<dc:creator>MarkB</dc:creator>
				<category><![CDATA[Navigation]]></category>
		<category><![CDATA[child pages]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[sub pages]]></category>

		<guid isPermaLink="false">http://wpguru.co.za/?p=3</guid>
		<description><![CDATA[A prime feature of most CMS systems is that pages have a strong hierarchy - plenty of pages, sub-pages and sub-sub-sub pages. Depending on exactly what you want to accomplish, there's a main means of doing this that will help you have a nicely dynamic navigation area.]]></description>
			<content:encoded><![CDATA[<p>A prime feature of most CMS systems is that pages have a strong hierarchy &#8211; plenty of pages, sub-pages and sub-sub-sub pages. Depending on exactly what you want to accomplish, there&#8217;s a main means of doing this that will help you have a nicely dynamic navigation area.</p>
<p>At first glance</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">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: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8230;would be an option, except that when you end up on a child page, the list disappears because the current page no longer has any children.</p>
<p>Enter the solution:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'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&amp;exclude=2'</span><span style="color: #009900;">&#41;</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;&quot;</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;exclude=2'</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: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span>get_the_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</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;&quot;</span><span style="color: #339933;">;</span>
wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'child_of='</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;title_li=&amp;exclude=2'</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: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>What this does is:</p>
<ul>
<li>Generate a list of sibling pages if there are no child pages present</li>
<li>If there are child pages, they&#8217;ll be shown</li>
</ul>
<p>This is really useful for creating a dynamic navigation that constantly allows users to move to other pages on the site and will also allow your client or the end user to create pages and sub pages freely without having to worry about digging through code to update the navigation area.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpguru.co.za/navigation/displaying-child-pages-of-the-current-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
