WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to figure out a way to add a <button></button> element to a link inside of the wp menu

I currently have this markup:

$defaults = array(
    'theme_location'  => '',
    'menu'            => 'main-nav',
    'container'       => 'ul',
    'container_class'    => 'nav navbar-nav',
    'before'          => '<button class="btn btn-warning">',
    'after'           => '</button>',
    'menu_class'      => '',
    'menu_id'         => 'menu',
    'echo'            => true,
    'fallback_cb'     => 'wp_page_menu',
    'link_before'     => '',
    'link_after'      => '',
    'items_wrap'      => '<div class="col-md-6 col-md-offset-3">%3$s</div>',
    'depth'           => 0,
    'walker'          => ''
wp_nav_menu( $defaults );

Here is an example of my site

With the current structure in place above, it seems like the links work fine for chrome except for firefox and ie

Any suggestions would be great!

share|improve this question
Thanks Peter, I apologize for my inexperience with this website. – Kyle Poyser Aug 11 '14 at 18:13
Anyone have a good solution for this? – Kyle Poyser Aug 12 '14 at 16:18
For bootstrap's <button> element it calls for the href link inside of the <button class="class" href=""></button> – Kyle Poyser Aug 12 '14 at 16:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.