WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15196 closed defect (bug) (invalid)

menu css

Reported by: meerblickzimmer Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Menus Keywords:
Focuses: Cc:

Description

The function wp_nav_menu has bug i the css-class.

<div class="menu-topmenu-container">
	<ul id="menu-topmenu" class="menu">
		<li id="menu-item-169" class="menu-item menu-item-type-custom menu-item-169"><a href="#">Top 1</a> 
			<ul class="sub-menu"> 
				<li id="menu-item-148" class="menu-item menu-item-type-post_type menu-item-148"><a href="#">sub 1</a></li> 
				<li id="menu-item-164" class="menu-item menu-item-type-taxonomy menu-item-164"><a href="#">sub 2</a></li> 
				<li id="menu-item-163" class="menu-item menu-item-type-taxonomy current-post-ancestor current-menu-parent current-post-parent menu-item-163"><a href="#">sub 3</a></li> 
				<li id="menu-item-156" class="menu-item menu-item-type-taxonomy menu-item-156"><a href="#">sub 4</a></li> 
				<li id="menu-item-143" class="menu-item menu-item-type-post_type menu-item-143"><a href="h#">sub 5</a></li> 
			</ul> 
		</li> 
	</ul> 
</div> 

sub3 is a category and if i show a single post from this category, the sub 3 get a class "current-post-parent". Thats right. But: top1 needs also f.eks. a current-post-ancestor-class. My code-eksampel shows nothing that top1 includes a selceted menu-item.

Change History (1)

comment:1 filosofo3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

There are two legitimate ways in which "Top 1" could be an ancestor of your single post: The object "Top 1" represents could actually be ancestor of the single post object, or the single post object could have a corresponding menu item underneath "Top 1" in the menu hierarchy.

Neither of those is the case.

To put it another way, the hierarchies involved are different:

  • Top 1 -> sub 3: Relationship of menu item to menu item
  • sub 3 -> single post: Relationship of object to object.

There is no transitivity to make a relationship between top 1 and single post.

Note: See TracTickets for help on using tickets.