Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#14027 closed defect (bug) (duplicate)

Inconsistent menu markup makes styling very difficult

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords:
Focuses: Cc:


When inserting a menu like so:

<?php wp_nav_menu(array(
	'theme_location' => 'header',
	'container_class' => 'header-menu',
	'container_id' => 'header-menu',
	'depth' => 1,
	)); ?>

The result markup looks like this:

<div id="header-menu" class="header-menu"><ul id="menu-header-nav-menu" class="menu"><li id="menu-item-66" class="menu-item menu-item-type-post_type">...

Unless the menu is empty/undefined... In this case, you get the following:

<div class="menu"><ul><li class="page_item page-item-60 current_page_parent">...

This makes menu styling overly complicated...

In addition, the container parameter gets ignored if an empty string is entered. So there is no means to get rid of the useless div.

Change History (4)

#1 @nacin
14 years ago

container = false will rid the container.

#2 @Denis-de-Bernardy
14 years ago

Cool! It doesn't get rid of the latter, let alone insert the similar classes, when the menu is not configured however.

#3 @nacin
14 years ago

Yeah... Duplicate of #13998 and/or #13979 then?

#4 @Denis-de-Bernardy
14 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Seems so

Note: See TracTickets for help on using tickets.