how to set css and html structure in wp_nav_menu() function in wordpress -
i have html coded navigation menu has css
style , cool animation. wants add css
, structure in word press
. have tried , used in wp_nav_menu()
.but result far. how use css in word press. css included , working fine if using statically navigation html
.
$defaults = array( 'theme_location' => 'header-menu', 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'depth' => 0, 'walker' => '' ); wp_nav_menu( $defaults );
wants add css in wordpress navigation menu
<ul class="menu"> <li class="current-menu-parent"><a href="javascript:void(0)" title="lorem ipsum vivams vitae sodales">home</a> <ul class="sub-menu"> <li class="current-menu-item"><a href="home.html">background color</a></li> <li><a href="home2.html">background color fullwidth slider</a></li> <li><a href="home3.html">clean style</a></li> <li><a href="home4.html">clean style fullwidth slider</a></li> <li><a href="home5.html">background image</a></li> </ul> </li> <li><a href="javascript:void(0)" title="egestas cras eres mauri pellentesque">pages</a> <ul class="sub-menu"> <li><a href="about.html">about</a></li> <li><a href="full-width.html">full width</a></li> <li><a href="gallery.html">gallery</a></li> <li><a href="404.html">404 page</a></li> <li><a href="sitemap.html">sitemap</a></li> </ul> </li> </ul>
is not dificult that. need declare class of menu in array. here exemple:
<?php $defaults = array( 'theme_location' => '', 'menu' => 'topmenu', 'container' => 'ul', 'container_class' => 'topmenu-{topmenu slug}-container', 'container_id' => 'topmenu', 'menu_class' => 'topmenu', 'menu_id' => 'topmenu-{topmenu slug}[-{increment}]', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'depth' => 0, 'walker' => '' ); ?> <?php wp_nav_menu( $defaults ); ?>
in "topmenu" css class. believe here able customize menu.
hope help's you! if need css sample, let me know!
Comments
Post a Comment