<?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>BuyNowShop &#187; custom menu</title>
	<atom:link href="http://buynowshop.com/tag/custom-menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://buynowshop.com</link>
	<description>WordPress administration, installation, and development.</description>
	<lastBuildDate>Tue, 31 Jan 2012 20:32:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Featured in DMM v1.7</title>
		<link>http://buynowshop.com/2010/07/featured-in-dmm-v1-7/</link>
		<comments>http://buynowshop.com/2010/07/featured-in-dmm-v1-7/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 21:26:02 +0000</pubDate>
		<dc:creator>Edward Caissie</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[custom menu]]></category>
		<category><![CDATA[desk mess mirrored]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[WPFirstAid]]></category>

		<guid isPermaLink="false">http://buynowshop.com/?p=1442</guid>
		<description><![CDATA[The custom menu code featured in the free WordPress theme Desk Mess Mirrored version 1.7
Related posts:<ol>
<li><a href='http://buynowshop.com/2009/07/hide-a-menu-page/' rel='bookmark' title='Hide a Menu Page'>Hide a Menu Page</a></li>
<li><a href='http://buynowshop.com/2011/07/desk-mess-mirrored-1-9/' rel='bookmark' title='Desk Mess Mirrored 1.9'>Desk Mess Mirrored 1.9</a></li>
<li><a href='http://buynowshop.com/2010/09/bns-featured-category-1-8-1/' rel='bookmark' title='BNS Featured Category 1.8.1'>BNS Featured Category 1.8.1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>DMM = the Desk Mess Mirrored theme</p>
<p>Just a quick preview of one of the upcoming featured changes to the Desk Mess Mirrored theme: custom menus via the <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu"><em>wp_nav_menu()</em></a> function.</p>
<p>The current code for Desk Mess Mirrored version 1.6 in <em>header.php</em> for menus is this (cleaned up for display):</p>
<pre class="brush: php; first-line: 41; highlight: [46]; title: ; notranslate">
&lt;?php if ( is_home() || is_front_page()) { ?&gt;
	&lt;?php wp_list_pages( 'title_li=&amp;depth=1&amp;include=2' ); ?&gt;
	&lt;?php wp_list_pages( 'title_li=&amp;depth=1&amp;exclude=2' ); ?&gt;
&lt;?php } else { ?&gt;
	&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo( 'url' ); ?&gt;&quot;&gt;&lt;?php _e( 'Home', 'desk-mess-mirrored' ) ?&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;?php wp_list_pages( 'title_li=&amp;depth=1' ); ?&gt;
&lt;?php } ?&gt;
</pre>
<p>All of that code is simply replaced by this line:</p>
<pre class="brush: php; first-line: 41; title: ; notranslate">
&lt;?php dmm_nav_menu(); ?&gt;
</pre>
<p>The function <em>dmm_nav_menu()</em> is referring to this section of code now found in the functions.php template file: </p>
<pre class="brush: php; first-line: 88; highlight: [106]; title: ; notranslate">
    // Add wp_nav_menu() custom menu support
    add_theme_support( 'menus' );
    function dmm_nav_menu() {
      if ( function_exists( 'wp_nav_menu' ) )
        wp_nav_menu( array(
                           'theme_location' =&gt; 'top-menu',
                           'depth' =&gt; 1,
                           'fallback_cb' =&gt; 'dmm_list_pages'
                           ) );
      else
        dmm_list_pages();
    }

    function dmm_list_pages() {
      if ( is_home() || is_front_page() ) {
        wp_list_pages( 'title_li=&amp;depth=1' );
      } else { ?&gt;
        &lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo( 'url' ); ?&gt;&quot;&gt;&lt;?php _e( 'Home', 'desk-mess-mirrored' ) ?&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;?php wp_list_pages( 'title_li=&amp;depth=1' );
      }
    }

    add_action( 'init', 'register_dmm_menu' );
    function register_dmm_menu() {
      register_nav_menu( 'top-menu', __( 'Top Menu' ) );
    }
    // wp_nav_menu() end
</pre>
<p>Notice the highlighted lines are identical which means at the default settings after updating to version 1.7 you should see no difference in how your site looks, but you are now able to set the menu links using the interface under Appearance | Menus. Also note, the menu is still set as a top-level or parent only menu. Future versions of DMM may offer drop-down menus and other options but they are not currently scheduled for a particular release date or version at this time.</p>
<p>All of these changes were based on the article I wrote at <a href="http://wpfirstaid.com">WPFirstAid.com</a> titled: <a href="http://wpfirstaid.com/2010/07/upgrade-wp_list_pages-to-wp_nav_menu/">Upgrade wp_list_pages() to wp_nav_menu()</a>.</p>
<p>Enjoy!</p>
<p style='text-align:left'>&copy; 2010, <a href='http://buynowshop.com'>BuyNowShop</a>. All rights reserved. </p>
<p>Related posts:<ol>
<li><a href='http://buynowshop.com/2009/07/hide-a-menu-page/' rel='bookmark' title='Hide a Menu Page'>Hide a Menu Page</a></li>
<li><a href='http://buynowshop.com/2011/07/desk-mess-mirrored-1-9/' rel='bookmark' title='Desk Mess Mirrored 1.9'>Desk Mess Mirrored 1.9</a></li>
<li><a href='http://buynowshop.com/2010/09/bns-featured-category-1-8-1/' rel='bookmark' title='BNS Featured Category 1.8.1'>BNS Featured Category 1.8.1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://buynowshop.com/2010/07/featured-in-dmm-v1-7/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

