<?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>fuzzymargins &#187; PHP</title>
	<atom:link href="http://www.fuzzymargins.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fuzzymargins.com</link>
	<description>Life is full of code</description>
	<lastBuildDate>Sun, 07 Mar 2010 14:21:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Move the WordPress pages to the header &#8211; revisited</title>
		<link>http://www.fuzzymargins.com/2010/01/move-the-wordpress-pages-to-the-header-revisited/</link>
		<comments>http://www.fuzzymargins.com/2010/01/move-the-wordpress-pages-to-the-header-revisited/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:42:26 +0000</pubDate>
		<dc:creator>jamespiggot</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.fuzzymargins.com/?p=332</guid>
		<description><![CDATA[This updated article describes how to use the page widget to build a page menu in the WordPress header. For the background to this see the previous post Move the WordPress page links to the header that described a simple way of listing the page links on the header. This method makes use of the [...]]]></description>
			<content:encoded><![CDATA[<p>This updated article describes how to use the page widget to build a page menu in the WordPress header. For the background to this see the previous post <a href="http://www.fuzzymargins.com/2009/04/move-the-wordpress-page-links-to-the-header/">Move the WordPress page links to the header</a> that described a simple way of listing the page links on the header.<br />
<span id="more-332"></span><br />
This method makes use of the Pages widget which allows pages to be excluded from the menu and also allows the sort order of the pages to be specified. To view this from the dashboard expand Appearance in the left-hand sidebar then select Widgets. You can then use the Widget to set up a list of page links in the sidebar.</p>
<p><img src="http://www.fuzzymargins.com/wp-content/uploads/2010/01/Widgets_Pages.gif" alt="WordPress Pages widget" title="WordPress Pages widget" width="252" height="243" class="alignnone size-full wp-image-195" /></p>
<p>The first thing is to find the path to the theme that you are using, for the default theme the path is:</p>
<p class="highlight">&frasl;wordpress&frasl;wp-content&frasl;themes&frasl;default</p>
<p>For other themes the path will vary so make sure you have identified the correct one for the theme you have in use. </p>
<p>Then using your favourite text editor open up the following files:</p>
<ul>
<li><strong>functions.php</strong></li>
<li><strong>header.php</strong></li>
</ul>
<p class="note"><strong>Note:</strong> Before you make any changes to these files make sure you have a backup</p>
<p>In functions.php add the following code in an appropriate place. </p>
<pre><code>function list_pages($pages) {
$options = get_option( 'widget_pages' );
foreach ($options as $key=&gt;$value) {
        if ( $pages == $options[$key]['title'])	{
			$sortby = $options[$key]['sortby'];
			$exclude = $options[$key]['exclude'];
        	if ( $sortby == 'menu_order' ) {
				$sortby = 'menu_order, post_title';
				}
			$out = wp_list_pages( apply_filters('widget_pages_args',
					array('title_li' =&gt; '',
					'echo' =&gt; 0,
					'sort_column' =&gt; $sortby,
					'exclude' =&gt; $exclude) ) );
        	if ( !empty( $out ) ) {
				?&gt;
				&lt;li&gt;&lt;?php echo $out; ?&gt;&lt;/li&gt;
				&lt;?php
				}
        	}
		}
}</code></pre>
<p>Then add the following line of code in the <em>header.php</em> file. The correct location will vary by theme but generally it will be within the <em>header div</em>.</p>
<pre><code>&lt;ul&gt;&lt;?php list_pages('Header1'); ?&gt;&lt;/ul&gt;</code>
</pre>
<p>The effect of this will be to list the pages defined by the Pages widget that has a title of <em>Header1</em>, you can edit the the parameter above for list_pages to match the one you are already using. This should work with WordPress 2.8 onwards but probably will not work with previous versions to that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fuzzymargins.com/2010/01/move-the-wordpress-pages-to-the-header-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
