最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

menus - Does the Default theme of Wordpress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class

programmeradmin0浏览0评论

I want to know if these themes uses Walker_Nav_Menu class. As I open the files I can't see a Walker_Nav_Class or I could not find it. And I want to know what they use to display the Menu and Submenus. Thanks in advance.

I want to know if these themes uses Walker_Nav_Menu class. As I open the files I can't see a Walker_Nav_Class or I could not find it. And I want to know what they use to display the Menu and Submenus. Thanks in advance.

Share Improve this question edited Sep 25, 2019 at 4:40 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Sep 25, 2019 at 3:00 Lucifer LeviLucifer Levi 932 silver badges11 bronze badges 1
  • If we create a sub menu for the parent menu, the wp_nav_menu() generate the sub menu's with ul li tag, the ul tag contains the class of 'sub-menu'. In style they written the design for submenus – Gopala krishnan Commented Sep 25, 2019 at 4:57
Add a comment  | 

1 Answer 1

Reset to default 0

They just use the default markup. You only need to define your own walker class if you’re changing the markup from the default. Believe it or not, but it’s perfectly possible to create menus without Bootstrap!

The only exceptions to the default menu markup is that some of the default themes, like Twenty Nineteen, use the walker_nav_menu_start_el filter to add SVG social icons to its social links menu, and SVG icons for the dropdown indicators. But this does not involve a custom walker class.

发布评论

评论列表(0)

  1. 暂无评论