Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

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.

Example of Home Page

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

Menu Structure

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

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.

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

Step 8:- Refresh the custom theme site.

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

What is CodeIgniter and use cases of CodeIgniter?

What is CodeIgniter? CodeIgniter is an open-source PHP web application framework designed to simplify and accelerate web development. It follows the Model-View-Controller (MVC) architectural pattern and provides…

Read More

What is PHP and use cases of PHP?

What is PHP? Are you wondering what PHP is and how it works? Look no further! In this article, we will explore the ins and outs of…

Read More

Complete guide on PHP certification courses, tutorials & training

What is PHP Hypertext Preprocessor is known as PHP. Many developers use PHP, an open-source server-side programming language, to create websites. In addition, it is a general-purpose…

Read More

Complete PHP with Laravel Certification Guide & tutorials

What is PHP with Laravel? PHP was visioned eventually in the fall of 1994 by Rasmus Lerdorf. PHP means Hypertext Preprocessor. It’s a extensively- used, open source…

Read More

Top 50 PHP Interview Questions and Answers

1) What is PHP? PHP is an open-source, interpreted, and object-oriented scripting language that can be executed at the server-side. PHP is well suited for web development….

Read More

Complete guide of PHP certification courses, tutorials & training

PHP is a great beginner programming language for anyone who is wanting to cross over into the coding world. Though easy to learn, it is an extremely…

Read More