Is possible turn a tag to WordPress menu?
-
Hi
First I try two of the tutorial below, it doesn’t work for me. I also check the WordPress documentation.
I try to convert my HTML design to WordPress theme. find out WordPress use ul or li element for the menu, but in design, I use < a> element for the navbar, I have been trying this for 2 days. they do not convert correctly. Thinking about changing them to ul or li, but my CSS stylesheet will need big updated it. Does anyone have any solution? please?
my navbar code:
<div class="div-block-18"> <div data-collapse="medium" data-animation="default" data-duration="400" class="navbar w-nav"> <div class="container w-container"> <a href="index.html" class="w-nav-brand"> <div> <img src="<?php bloginfo(stylesheet_directory)?>/assets/images/your-logo300.png" class="image-5"> </div> </a> <nav role="navigation" class="nav-menu w-nav-menu"> <a href="index.html" class="nav-link w-nav-link"><strong class="bold-text">HOME</strong></a> <a href="about.html" class="nav-link-2 w-nav-link"><strong class="bold-text-2">ABOUT</strong></a> <a href="blog.html" class="nav-link-3 w-nav-link"><strong class="bold-text-3">BLOG</strong></a> <a href="shop.html" class="nav-link-3 w-nav-link"><strong class="bold-text-4">SHOP</strong></a> <a href="resource.html" class="nav-link-3 w-nav-link"><strong class="bold-text-5">RESOURCE</strong></a> <a href="contact.html" class="nav-link-4 w-nav-link"><strong class="bold-text-6">CONTACT</strong></a> </nav> <div class="menu-button w-nav-button"> <div class="w-icon-nav-menu"></div> </div> </div> </div>
Here’s the first one I try also:
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => 'nav', 'container_class' => 'div-block-18', 'menu_class' => 'nav-link w-nav-link' )); ?>
Here’s the second one I try:
<?php $defaults = array( 'theme_location' => 'top_menu', 'menu' => '', 'container' => '', 'container_class' => '', 'container_id' => '', 'menu_class' => 'w-nav-menu main-nav', 'menu_id' => '', 'echo' => false, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<nav id="%1$s" class="%2$s">%3$s</nav>', 'depth' => 0, 'walker' => '' ); $find = array('><a', '<li'); $replace = array('', '<a'); echo str_replace($find, $replace, wp_nav_menu( $defaults )); ?>
Thank you guys so much!
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
- This topic was modified 6 years, 10 months ago by .
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Is possible turn a tag to WordPress menu?’ is closed to new replies.