admin管理员组文章数量:1134232
Whats the difference between current_page_item
and current-menu-item
when using Custom Menus
.current_page_item{} // Class for Current Page
.current-cat{} // Class for Current Category
.current-menu-item{} // Class for any other current Menu Item
.menu-item-type-taxonomy{} // Class for a Category
.menu-item-type-post_type{} // Class for Pages
.menu-item-type-custom{} // Class for any custom item that you added
.menu-item-home{} // Class for the Home Link
Whats the difference between current_page_item
and current-menu-item
when using Custom Menus
.current_page_item{} // Class for Current Page
.current-cat{} // Class for Current Category
.current-menu-item{} // Class for any other current Menu Item
.menu-item-type-taxonomy{} // Class for a Category
.menu-item-type-post_type{} // Class for Pages
.menu-item-type-custom{} // Class for any custom item that you added
.menu-item-home{} // Class for the Home Link
Share
Improve this question
asked Apr 18, 2011 at 5:36
JM at WorkJM at Work
2,3236 gold badges35 silver badges42 bronze badges
1 Answer
Reset to default 6current_menu_item is the active element in the menu, independent from the type (page, archives, post, etc.) of the current menu element, while current_page_item only available, if the current item is a page and is current.
For more details: https://developer.wordpress.org/reference/functions/wp_nav_menu/#menu-item-css-classes
本文标签: Whats the difference between currentpageitem and currentmenuitem
版权声明:本文标题:Whats the difference between current_page_item and current-menu-item 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736821380a1954299.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论