How do I display menu in header without loosing styles?

I have downloaded a template and trying to convert it into the wordpress theme. How do I add the menu in wordpress and not loose styles that are applied to it?

I have this code in my header.php

<div
class=”collapse navbar-collapse main-menu-item justify-content-center”
id=”navbarSupportedContent”
>
<ul class=”navbar-nav align-items-center”>
<li class=”nav-item”>
<a class=”nav-link” href=”index.php”>Home</a>
</li>
<li class=”nav-item”>
<a class=”nav-link” href=”about-us.php”>About</a>
</li>
<li class=”nav-item”>
<a class=”nav-link” href=”services.html”>services</a>
</li>
<li class=”nav-item”>
<a class=”nav-link” href=”blog.html”>Blog</a>
</li>
<li class=”nav-item dropdown”>
<a
class=”nav-link dropdown-toggle”
href=”blog.html”
id=”navbarDropdown”
role=”button”
data-toggle=”dropdown”
aria-haspopup=”true”
aria-expanded=”false”
>
Pages
</a>
<div class=”dropdown-menu” aria-labelledby=”navbarDropdown”>
<a class=”dropdown-item” href=”project.html”>project</a>
<a class=”dropdown-item” href=”single-blog.html”
>Single blog</a
>
<a class=”dropdown-item” href=”elements.html”>Elements</a>
</div>
</li>
<li class=”nav-item”>
<a class=”nav-link” href=”contact.html”>Contact</a>
</li>
</ul>
</div>

I tried registering menu but in doing so I am loosing all my styles and menu just appears in simple text format. There is also an effect that make the header navigation bar sticky and changes color when it is scrolled.

I tried to register menu using this

//add menu support
add_theme_support(‘menus’);

//register menu support
register_nav_menus(

array(
‘top-menu’ => __(‘Top Menu’,’theme’),
)

)

How do I solve this?

Read more here:: How do I display menu in header without loosing styles?

Leave a Reply

Your email address will not be published. Required fields are marked *