I want to create a custom menu for my theme. The default menu architecture created by wordpress wp_nav_menu() function is made by <ul> <li> tags. But my custom Menu architecture is:

  <div class="ui sidebar inverted vertical menu">
    <a href="#" class="item">
    <a href="#" class="item">
    <a href="#" class="item">
  <div class="pusher">
    <!-- Site content !-->

How can I create such a menu for my custom theme?

I tried using custom walker function... but I am not able to understand, how does the function work.

  • Is there a reason the ul and li tags wont work? – Will Aug 30 '15 at 18:16

You can remove the container and ul tag like this:

<?php wp_nav_menu( array(
   'container' => '',
   'items_wrap' => '%3$s'
) ); ?>

Now you can see an architecture like this:

  <a href="#">item</a>

And i think you could adjust your stylesheet to adapt "li" tag.

Hope it helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.