show custom menu in page tpl file &lt;?php if (isset($custom_links)) { ?&gt;
&lt;div id="secondaryNav"&gt;&lt;?php print theme('links', $custom_links) ?&gt;&lt;/div&gt;
&lt;?php } ?&gt; 


I've create a custom menu (machine name: menu-secondary-menu). And I want to display it in page.tpl. My condition is to show this this menu only if it has links added. I searched and found the above code. Please help me in customizing to my need.
&lt;?php
// Enter the machine name of the menu you want to show.
$menu_name = 'main-menu';
// Check if there are any menu items in it.
if (count(menu_navigation_links($menu_name))):
?&gt;
&lt;div id="secondaryNav"&gt;
  &lt;?php print theme('links', array('links' =&gt; menu_navigation_links($menu_name), 'attributes' =&gt; array('id' =&gt; $menu_name, 'class'=&gt; array('links', 'inline')))); ?&gt;
&lt;/div&gt;
&lt;?php endif; ?&gt;