0

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:

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

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
0

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:

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

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.