<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>WordPress Bits &#187; Pages</title>
	<atom:link href="http://wpbits.wordpress.com/category/wordpress/pages/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpbits.wordpress.com</link>
	<description>Hacking WordPress. Keeping the bits together.</description>
	<lastBuildDate>Tue, 18 Dec 2007 07:46:40 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='wpbits.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/cb9a73de53854d3a658a4a104c191a09?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>WordPress Bits &#187; Pages</title>
		<link>http://wpbits.wordpress.com</link>
	</image>
			<item>
		<title>Home and the rest of main menu on a WordPress based web site</title>
		<link>http://wpbits.wordpress.com/2007/08/03/home-and-the-rest-of-main-menu-on-a-wordpress-based-web-site/</link>
		<comments>http://wpbits.wordpress.com/2007/08/03/home-and-the-rest-of-main-menu-on-a-wordpress-based-web-site/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 08:23:55 +0000</pubDate>
		<dc:creator>Leonid Mamchenkov</dc:creator>
				<category><![CDATA[Menu]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/08/03/home-and-the-rest-of-main-menu-on-a-wordpress-based-web-site/</guid>
		<description><![CDATA[Now that we established that WordPress is not just a blogging engine, but a complete platform, which can be used for building all sorts of web sites, it is time to look at some issues which arise along the way.  Today, I&#8217;ll show one of the ways to go about creating web site&#8217;s main [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wpbits.wordpress.com&blog=1243059&post=44&subd=wpbits&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Now that we established that <a href="http://wpbits.wordpress.com/2007/06/18/wordpress-webapp-framework-more-than-a-blogging-engine-more-than-a-cms/">WordPress is not just a blogging engine</a>, but a complete platform, which can be used for building all sorts of web sites, it is time to look at some issues which arise along the way.  Today, I&#8217;ll show one of the ways to go about creating web site&#8217;s main menu.</p>
<p><span id="more-44"></span></p>
<p>For most traditional web sites, WordPress pages provide all required navigational functionality.  Simply create pages for main menu items, like &#8220;About Us&#8221;, &#8220;Contact Us&#8221;, &#8220;Services&#8221;, &#8220;Company Profile&#8221;, etc.  Those pages which need sub-sections, can have sub-pages (via &#8220;Page Parent&#8221; selection box).</p>
<p>Pages can be ordered in a number of ways with parameters in the theme files, and there is even some control in the administration interface.  Take a look at arguments for  <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a> function and &#8220;Page Order&#8221; selection box in the administration interface.</p>
<p>The biggest issue that I came across, is the one with Home link. There is usually a company or web site logo, which is linked to the front page of the site, but often also a main menu item makes sense.   People expect a &#8220;Home&#8221; or &#8220;Main&#8221; or &#8220;Front page&#8221; link in the main menu.</p>
<p>OK, no problem.  We create a separate page, call it &#8220;Home&#8221; and arrange the ordering for it to be the first. Also, in the <em>Options-&gt;Reading</em> we select &#8220;<em>Front page displays a static page</em>&#8221; and select our &#8220;Home&#8221; page.  Now our menu works just fine.</p>
<p>Except for the tiny little detail &#8211; &#8220;Home&#8221; link in the menu doesn&#8217;t point to the web site&#8217;s front page, but to an address of the page.  With fancy URLs it might not be that noticeable (<em>/home</em>), but with regular links, it doesn&#8217;t look right (<em>/page_id=2</em>). <span style="font-weight:bold;">Updated</span>: this seems to be not true for the newer version of WordPress, which use blog&#8217;s home automatically. Thanks to Rich Schmidt for pointing this out.</p>
<p>Also, our front page looks a little bit strange, with the title &#8220;Home&#8221; instead of something more traditional like &#8220;Welcome to our new web site!&#8221;.  We could, of course, take care of this by using a different template for the front page, but why bother, especially when we can solve both issues at the same time and do it easily to.</p>
<p>A quick and simple solution is to separate the &#8220;Home&#8221; link from the rest of the pages menu.  So, instead of:</p>
<p><img src="http://wpbits.files.wordpress.com/2007/08/wp_list_pages.png" alt="wp_list_pages()" /></p>
<p>We&#8217;ll have something like this:</p>
<p><img src="http://wpbits.files.wordpress.com/2007/08/main_menu_with_wp_list_pages.png" alt="Main menu with wp_list_pages()" /></p>
<p>Here, 2 is the ID of our &#8220;Home&#8221; page, which we want to exclude from the main menu (check Codex for more about <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a> ). Otherwise we&#8217;ll have two entries in there and it will be confusing.</p>
<p><strong>Update:</strong>  Thanks to Adam and Greg (see comments) for a better way to do the above:</p>
<p><img src="http://wpbits.files.wordpress.com/2007/08/main_menu_with_wp_list_pages_proper.png" alt="Proper way to do main menu with wp_list_pages()" /></p>
<p>So, now, not only our &#8220;Home&#8221; link in the main menu points to something sensible, but we also get to choose our front page title separately from the menu item.</p>
<p>This approach works well if your web site can be easily structured with pages and you need only a few pages to be handled separately (&#8220;Disclaimer&#8221;, &#8220;Privacy Policy&#8221; are two other frequent things that you want to exclude from the main menu and show separately at the bottom of the page, or something like that).</p>
<p>If your web site should be more flexible with page titles and menu items, but you still want to keep the administration simple (because, most probably, very non-technical people will handle the content), you can use Links instead.  We&#8217;ll see how to do it next time.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wpbits.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wpbits.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wpbits.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wpbits.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wpbits.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wpbits.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wpbits.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wpbits.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wpbits.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wpbits.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wpbits.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wpbits.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wpbits.wordpress.com&blog=1243059&post=44&subd=wpbits&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wpbits.wordpress.com/2007/08/03/home-and-the-rest-of-main-menu-on-a-wordpress-based-web-site/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54bfadc28c22bf76402608db646cd031?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mamchenkov</media:title>
		</media:content>

		<media:content url="http://wpbits.files.wordpress.com/2007/08/wp_list_pages.png" medium="image">
			<media:title type="html">wp_list_pages()</media:title>
		</media:content>

		<media:content url="http://wpbits.files.wordpress.com/2007/08/main_menu_with_wp_list_pages.png" medium="image">
			<media:title type="html">Main menu with wp_list_pages()</media:title>
		</media:content>

		<media:content url="http://wpbits.files.wordpress.com/2007/08/main_menu_with_wp_list_pages_proper.png" medium="image">
			<media:title type="html">Proper way to do main menu with wp_list_pages()</media:title>
		</media:content>
	</item>
	</channel>
</rss>