How to Add a Custom Navigation Menu in WordPress



How to Add a Custom Navigation Menu in WordPress

If you’ve been working with WordPress as long as I have then it is inevitable that you will need to add custom features and functionality to your WordPress site. It is easier than you think to add your own custom navigation menu in WordPress.

You will need to edit the functions.php file, and the php file where you want to add your custom navigation menu. This could be the header.php file, the index.php file, the archive.php file, or the footer.php file. First, we need to add a line of code at the bottom  of the functions.php file in order to enable the custom menu. Copy and paste this line of code:

add_theme_support( 'menus' );

Now that you have enabled this, you can create custom menus in the Appearance section of your WordPress Admin Area. You can order your menu any way that you’d like. You can include posts, pages and custom urls in your custom navigation menu in WordPress. To add your custom navigation menu in WordPress wherever you’d like, simply paste the following code:

<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-footer' ) ); ?>

In the PHP above you are asking for a WordPress navigation menu, and what the code is telling WordPress to do is to use the sort order that you had setup for your menu under the Appearance menu. this takes the order of the menu itself and displays your menu items in that order. As you add menus to your site, you will see WordPress update with menu locations where you can specify what menus to use and where they will be placed within your site. Notice the “+” symbol in the menu section. Here, you can create as many menus as you’d like, just be sure to name your custom menu something that you will recognize, to make it easy to remember where you want to place it.

custom_navigation_Menu_in_wordpress

custom_navigation_menu_in_Wordpress_2

Next, the container class determines the class that you will use in your css to style this menu. The reason that you do it this way, is because you might have several menus in different places, so this makes it easy for you to style in your CSS Stylesheet.

As you can see, this makes it really easy to implement your own custom navigation menu in WordPress quickly and easily. This is just one of the things that you can do to customize your WordPress site and make it easy for your visitors to find what they are looking for.





Your opinion is important to me. Be heard!

Dreamweaver Fireworks Flash Illustrator Indesign Lightroom Painter Photoshop Quark Typography
godzilla-fing-fang-foom
The Incredible Photoshop Work of Norman Soo

Norman Soo Every now and then you come across an artist...

New features of Illustrator
The Best New Features of Adobe Illustrator

The Best New Features of Adobe Illustrator I am glad to...

3dwireframefeat
Working With 3D in Illustrator

Being Aware of 3D in Illustrator Illustrator is the go-to place...

Premium
Monarch Social Sharing plugin
Breaking News: Elegant Themes Releases Monarch

Monach Social Sharing Those of you who’ve read my blog for...

large-background-images-feat
30 WordPress Themes With Large Background Images

Large Background Images Standard website layouts with logo and navigation on...

Responsive-web-design-devices
Mobile Design Vs. Responsive Design

Deciding between a mobile or responsive design can be a difficult...

Monarch Social Sharing plugin
Breaking News: Elegant Themes Releases Monarch

Monach Social Sharing Those of you who’ve read my blog for...

large-background-images-feat
30 WordPress Themes With Large Background Images

Large Background Images Standard website layouts with logo and navigation on...

WordPress video courses
Enter to Win 1 of 5 WordPress Seo Courses

WordPress Seo Courses Even if you’re a really advanced blogger, chances...

Bluehost: The Best web hosting provider
Who is the Best Web Hosting Company?

10 Best Web Hosting Companies Choosing the best hosting service for...