Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

wordpress theme menu support wtih dropdown sub menus WordPress

  • SOLVED

Hi There,

Site: http://www.urimagnation.com
Issue: In wordpress menu support with dropdown sub menus won't work.


Using wordpress on appearance => Menus I'm able to create the main menu items but when I add a submenu level it won't show/populate at all.

Here is the the header.php
===[only nav portion inserted]====
.....
<?php wp_nav_menu( array( 'menu' => 'Main Nav', 'menu_id' => 'nav_list', 'container' => 'div', 'container_id' => 'nav',
'container_class' => '', 'depth' => 1) ); ?>


Here is the style.css nemu portion
....
/* NAV */
#nav {float: right; height: 68px; position:relative; left: -50%;}
#nav_list { height: 63px; position:relative; left: 50%;
line-height: 63px; list-style: none outside none; margin: 0 auto;}
#nav_list li { display: block; float: left; padding: 0 1em;}
#content {clear: both;}
#nav_list li.current_page_item{ background: url(images/current_item.png) top center no-repeat;}
#nav_list li a{ color:#fff; text-decoration: none; display: block;}
....

Here is the functions.php for the theme
<?php
add_theme_support( 'menus' );
function pmc_services( $atts, $content ){
$content_inner = do_shortcode( $content );
$content =
'<section id="' . $atts['id'] . '" class="services">
<header>
<h2>' . $atts['title'] .'</h2>
</header>'
. $content_inner . '
</section>';
return pmc_remove_tags( $content );
}
add_shortcode( 'services', 'pmc_services' );
function pmc_service($atts, $content ){
$content =
'<section id="' . $atts['id'] . '" class="service_item">
<article>
<header>
<h3>' . $atts['title'] .'</h3>
</header>
' . $content . '
</article>
</section>';
return pmc_remove_tags( $content );
}
add_shortcode( 'service', 'pmc_service' );
function pmc_remove_tags( $content ){
return strip_tags( $content, '<p>' );
}

Thanks in advance.

Cheers
Alf

Answers (3)

2011-12-31

designchemical answers:

Try changing the depth parameter:


<?php wp_nav_menu( array( 'menu' => 'Main Nav', 'menu_id' => 'nav_list', 'container' => 'div', 'container_id' => 'nav',
'container_class' => '', 'depth' => 0) ); ?>


Alf Baez comments:

designchemical,

Thanks it looks like your solution is on the right path, the only thing is that after changing the 'depth' => 0).. it won't behave as a drill down submenu neither it won't roll back to normal. Could it be that we're missing a function for that?