WordPress Developer Ukraine, Kyiv
Block Navigation in WordPress: Converting Classic Menus

Block Navigation in WordPress: Converting Classic Menus

From classic menus to the Navigation block in a block theme A classic theme registers menu locations and prints them with wp_nav_menu(); the menus are edited in Appearance → Menus. A block theme has no menu locations: the header template part contains a Navigation block, and the menu items are stored in a wp_navigation post.…
Build a Custom WordPress Navigation Menu Walker for Bootstrap 5

Build a Custom WordPress Navigation Menu Walker for Bootstrap 5

Build a custom nav menu walker for Bootstrap dropdowns wp_nav_menu() prints a menu as nested <ul> and <li> elements with WordPress classes. CSS frameworks expect their own markup: Bootstrap’s navbar wants nav-item and nav-link classes, a dropdown-menu list and a toggle with data-toggle="dropdown". The class that writes the menu HTML is Walker_Nav_Menu, and a child…
How to Register and Display Navigation Menus in WordPress

How to Register and Display Navigation Menus in WordPress

Register and display navigation menus in a WordPress theme Menus are one of the first things a theme sets up. The theme declares menu locations, the site owner builds menus in Appearance → Menus and assigns them to the locations, and the templates print whatever menu is assigned. The theme never hard-codes the links.