MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to Display Navigation Menus of our Custom Theme in WordPress? Part-8

How to Display Navigation Menus of our Custom Theme in WordPress?

In blog Part-7, we have seen how to register Navigation Menus of our Custom Theme. We have to create pages to make menus.

Step 1:- Go to Dashboard->Pages->Add New Page. Name the first menu as Home page, second About page, third Menu page, forth Specials page, fifth Events page, sixth Gellary page, seventh Chefs page, eighth Contact page, ninth Book a Table page. Click Publish.

WordPress block editor with a new page titled Home, ready to publish
Example of Home Page

Step 2:-Go to Appearance->Menus–>Pages Check menu items boxes which are created and Click Add to Menu.

WordPress Appearance > Menus with restaurant pages checked, ready for Add to Menu in Header Main Menu

Menu Structure

WordPress Menu structure listing the added pages, from Book a Table to Home

Step 3:– Rearrange menus name according to your needs by dragging its.

WordPress menu reordered from Home to Book a Table, with Primary Menu display location option

Step 4:– To Display Location Checkbox of Primary Menu and Click Save Menu.

Step 5:- Go to index.php file of customtheme folder and delete the given nav-menu to see your created new nav-menu.

Index.php in Sublime Text with the hardcoded nav-menu list items selected for deletion

Step 6:– To display nav-menu, use pre-defined wp_nav_menu( array $args = array() ) method in WordPress. To more details of this method, visit https://developer.wordpress.org/reference/functions/wp_nav_menu/.

wp_nav_menu(array(
'menu' =>'primary-menu', //id of Primary Menu
'container' => '',
'items_wrap' =>'<ul class="nav navbar-nav navbar-right headerMenu">%3$s</ul>'
));
Code language: PHP (php)

Step 7:- Put this wp_nav_menu( array $args = array() ) method in nav-menu section

Index.php showing wp_nav_menu call with primary-menu and items_wrap inside the nav-menu section

Step 8:- Refresh the custom theme site.

Restaurantly custom theme site showing the new WordPress navigation menu from Home to Book a Table

Thanks

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
With MotoShare.in, you can book a bike instantly, enjoy doorstep delivery, and ride without worries. Perfect for travelers, professionals, and adventure enthusiasts looking for a seamless mobility solution.

Related Posts

How to Import DOCX into WordPress with Mammoth: Text, Images, Tables and Code

A practical, single-file publishing workflow for bloggers, technical writers and DevOps training teams. Figure 1. Original featured illustration (1200 × 630 pixels). Writing an excellent tutorial is…

Read More

WordPress Typography Patterns: Styled Lists, Notice Boxes, and Code Blocks with Reusable CSS

This guide modernizes a legacy WordPress typography post into practical, reusable patterns for custom list markers, callout boxes, and code styling. It focuses on maintainable CSS and editor-friendly markup you can reuse across posts and documentation pages.

Read More

Moving a WordPress Site to Webflow: What Happens to Your Hosting, DNS and Email

Most guides about Webflow answer one question: is it the right builder for you? This one starts after that decision. You have a WordPress site on Bluehost,…

Read More

How to Choose the Right Website Development and SEO Partner for Your Business

A professional website has evolved far beyond a digital business card or an online brochure. Today, it serves as the core foundation of a brand’s entire online…

Read More

Docker Compose: WordPress + MySQL Using Shared Environment Variables

Create a project folder: Create a .env file: Create docker-compose.yml: Start the containers: Open WordPress: Now students can see how environment variables are passed into both containers….

Read More

Top 10 Content Management Systems (CMS): Features, Pros, Cons & Comparison

Introduction A Content Management System (CMS) is software that helps individuals and organizations create, manage, organize, and publish digital content without needing deep technical or coding knowledge….

Read More