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
set-of-seamless-pattern_23-2147496045
Fun Vector Patterns

Fun Vector Patterns Everybody loves background patterns. Whether you use these...

bjango actions
Bjango Actions 2.0 (Awesome Photoshop Actions)

Bjango Actions 2.0 I love creating icons and icon sets. There’s...

vintage-vector-badges-feat
Free Retro & Vintage Vector Badges

Vintage Vector Badges There’s something special about vintage design that everyone...

Premium
open-cloud
Open Cloud Free Html5 Template

Open Cloud Free Html5 Template Finding unique website templates to share...

6
Top 10 WordPress Themes for Law Firms

Whenever you think of lawyers you think sharp suits, sharper tongues,...

konefix free html5 template
Konefix Free Html5 Template

Konefix Free Html5 Template A simple and streamlined site is usually...

6
Top 10 WordPress Themes for Law Firms

Whenever you think of lawyers you think sharp suits, sharper tongues,...

premium-wp-themes-feat
Selling the Better Idea: 50 Most Popular Premium WordPress Themes

The 50 Most Popular Premium WordPress Themes People want to be...

47405-wp-b
50 Premium Smashing Business WordPress Themes

Top 50 Smashing Business WordPress Themes for Success Sooner or later,...

premium Wordpress themes feat
3 Premium WordPress Themes for Free From ThemeFuse

3 Premium WordPress Themes for Free! The creative designers over at...