<?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>Programming Thematic 4 You &#187; Menu</title>
	<atom:link href="http://programming.thematic4you.com/tag/menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://programming.thematic4you.com</link>
	<description>Code Snippets and more ...</description>
	<lastBuildDate>Wed, 20 Oct 2010 10:24:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>How to test wp_nav_menu() with Thematic?</title>
		<link>http://programming.thematic4you.com/2010/03/how-to-test-wp_nav_menu-with-thematic/</link>
		<comments>http://programming.thematic4you.com/2010/03/how-to-test-wp_nav_menu-with-thematic/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 15:21:37 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Menu]]></category>
		<category><![CDATA[Superfish]]></category>
		<category><![CDATA[WordPress 3.0]]></category>
		<category><![CDATA[wp_nav_menu()]]></category>

		<guid isPermaLink="false">http://programming.thematic4you.com/?p=64</guid>
		<description><![CDATA[During the last weeks some people asked, how to test WordPress 3.0 and wp_nav_menu() with Thematic. Here's a first answer.]]></description>
			<content:encoded><![CDATA[<p>During the last weeks some people asked, how to test WordPress 3.0 and wp_nav_menu() with Thematic. Here&#8217;s a first answer.<span id="more-64"></span></p>
<p>First of all we need to register our new menu:</p>
<pre class="brush: php; title: ; notranslate">// Register 'Primary Menu'
register_nav_menus( array(
 'primary-menu' =&gt; __( 'Primary Navigation' ),
 ) );
</pre>
<p>Next step will be to remove the old menu from Thematic and add the new one:</p>
<pre class="brush: php; title: ; notranslate">// Remove standard menu
function remove_menu() {
	remove_action('thematic_header','thematic_access',9);
}
add_action('init', 'remove_menu');

// Create wp_nav_menu
function new_access() { ?&gt;
	&lt;div id=&quot;access&quot;&gt;
		&lt;div class=&quot;skip-link&quot;&gt;&lt;a href=&quot;#content&quot; title=&quot;&lt;?php _e('Skip navigation to the content', 'thematic'); ?&gt;&quot;&gt;&lt;?php _e('Skip to content', 'thematic'); ?&gt;&lt;/a&gt;&lt;/div&gt;
			&lt;?php wp_nav_menu( array( 'menu' =&gt; 'primary-menu', 'container_class' =&gt; 'menu', 'menu_class' =&gt; '', 'fallback_cb' =&gt; '' ) ); ?&gt;
	&lt;/div&gt;&lt;!-- #access --&gt;
&lt;?php
}
add_action('thematic_header','new_access',9);
</pre>
<p>And finally we need to add the needed UL class to support Superfish:</p>
<pre class="brush: php; title: ; notranslate">// Add the UL class to support Superfish
function wp_nav_menu_add_menuclass($ulclass) {
	return preg_replace('/&lt;ul&gt;/', '&lt;ul class=&quot;sf-menu&quot;&gt;', $ulclass, 1);
}
add_filter('wp_nav_menu','wp_nav_menu_add_menuclass');
</pre>
<p>Please keep in mind that WordPress 3.0 is still not final. This code might break at any time. Don&#8217;t rely on it!</p>
]]></content:encoded>
			<wfw:commentRss>http://programming.thematic4you.com/2010/03/how-to-test-wp_nav_menu-with-thematic/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

