<?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>WordPress Themes Tips and Tricks &#187; sort_column</title>
	<atom:link href="http://wpthemetips.com/tags/sort_column/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpthemetips.com</link>
	<description>Helping you customize your WordPress based website !</description>
	<lastBuildDate>Thu, 05 Nov 2009 00:48:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Working with Pages in WordPress</title>
		<link>http://wpthemetips.com/working-with-pages-in-wordpress/</link>
		<comments>http://wpthemetips.com/working-with-pages-in-wordpress/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 17:16:55 +0000</pubDate>
		<dc:creator>Sadish</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[menu_order]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[sort_column]]></category>
		<category><![CDATA[wp_list_pages]]></category>

		<guid isPermaLink="false">http://wpthemetips.com/working-with-pages-in-wordpress/</guid>
		<description><![CDATA[WordPress allows you to create &#8216;Pages&#8217; within the wordpress blog.
Anytime you want to write something like an about page / a contact page / an article page, you would use this feature.
Most of our themes displays a list of pages as navigational elements at the top. We use the wp_list_pages() method, so any new page [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress allows you to create &#8216;Pages&#8217; within the wordpress blog.<br />
Anytime you want to write something like an about page / a contact page / an article page, you would use this feature.</p>
<p>Most of <a href="http://sadish.net/wordpress-themes/" title="our themes">our themes</a> displays a list of pages as navigational elements at the top. We use the <code>wp_list_pages()</code> method, so any new page you create, will automatically display in that navigation. </p>
<p>I would like to present a few of the most common questions people ask, when they use one of our themes.</p>
<ol>
<li>How to hide certain pages from the navigation ?</li>
<li>How to display the pages in a different order ?</li>
<li>Why is my child page, is not listed in the navigation ? etc.</li>
</ol>
<p><span id="more-44"></span><br />
<code>wp_list_pages()</code> &#8211; is the wordpress method that generates a list of &#8216;links to pages&#8217;.<br />
Something like<br />
<code><br />
&lt;li class=&quot;page_item&quot;&gt;&lt;a href=&quot;http://wpthemepark.com/about/&quot; title=&quot;About&quot;&gt;About&lt;/a&gt;&lt;/li&gt;<br />
&lt;li class=&quot;page_item&quot;&gt;&lt;a href=&quot;http://wpthemepark.com/archives/&quot; title=&quot;Archives&quot;&gt;Archives&lt;/a&gt;&lt;/li&gt;<br />
&lt;li class=&quot;page_item&quot;&gt;&lt;a href=&quot;http://wpthemepark.com/contact/&quot; title=&quot;Contact&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;<br />
</code></p>
<p>We can call this method using different set of arguments.</p>
<p>Lets look at the Question 1 :</p>
<h3>How to hide certain pages from the navigation ?</h3>
<p>Suppose you wanted to hide &#8216;about&#8217; and &#8216;contact&#8217; pages from the top navigation.<br />
1. You login to your wordpress blog, and go to &#8216;Manage&#8217; -&gt; Pages<br />
2. You would see the list of all pages you created.<br />
3. Note down the Page Ids, the numbers on the left side of the Page Names, like 2 and 4.<br />
4. Now we have to modify the call to wp_list_pages in the header.php (Have a backup of this file if you want to go back to the original state) .<br />
5. Find wp_list_pages within this file.<br />
6. Add an additional argument &#8220;exclude=2,4&#8243; to that.<br />
<code><br />
&lt;?php wp_list_pages('title_li=&amp;depth=1&amp;exclude=2,4');?&gt;<br />
</code></p>
<p>Thats it. These pages will not get displayed in the top navigation.</p>
<p>Lets look at the Question 2 :</p>
<h3>How to display the pages in a different order ?</h3>
<p>1. You login to your wordpress blog, and go to &#8216;Manage&#8217; -&gt; Pages<br />
2. Click on &#8216;Edit&#8217; on the page you wanted to be first in the navigation.<br />
3. On the right hand side, you will see &#8216;Page Order&#8217; box.<br />
4. Expand that box, enter &#8216;1&#8242; as the value.<br />
5. Again go back to &#8216;Manage&#8217; &#8211; &gt; Pages<br />
6. Click on Edit on the page you wanted to be second in the navigation<br />
7. On the right hand side, enter &#8216;2&#8242; for the Page Order.<br />
8. Now we have to modify the call to wp_list_pages in the header.php (Have a backup of this file if you want to go back to the original state) .<br />
9. Find wp_list_pages within this file.<br />
10. Add an additional argument &#8220;sort_column=menu_order&#8221; to that.<br />
<code><br />
&lt;?php wp_list_pages ('title_li=&amp;depth=1&amp; sort_column=menu_order');?&gt;<br />
</code></p>
<p>Thats it. Your Pages list will be sorted in that order.</p>
<p>Lets look at the Question 1 :</p>
<h3>Why is my child page, is not listed in the navigation ? </h3>
<p>Because our themes are defined in such a way that it only displays top level pages in the navigation.</p>
<p>You might have seen &#8220;depth=1&#8243; as an argument in the examples presented above.This argument makes the child pages to be not displayed in the top navigation.</p>
<p>Thats all for now, folks.<br />
[Reposted from one of my other sites]</p>
]]></content:encoded>
			<wfw:commentRss>http://wpthemetips.com/working-with-pages-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
