Skip to content

Instantly share code, notes, and snippets.

View dbybanez's full-sized avatar
🍉
Watermelon

David dbybanez

🍉
Watermelon
View GitHub Profile
@kosinix
kosinix / custom-nav-walker-usage.php
Last active November 1, 2024 03:36
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>