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
Seamless winter patterns
Free Vector Winter Patterns

Winter Patterns In case you haven’t stepped outside recently, Winter is...

Picture 30
Molding Images to a Surface in Photoshop

Molding Images If you want to create some cool effects with...

Clinix - Free Bootstrap Templates
5 Free Bootstrap Templates Via ThemifyCloud

Bootstrap Templates Normally, I share one free HTML 5 or bootstrap-based...

Premium
Clinix - Free Bootstrap Templates
5 Free Bootstrap Templates Via ThemifyCloud

Bootstrap Templates Normally, I share one free HTML 5 or bootstrap-based...

joomla-main
An Introduction to Joomla

What is Joomla and it’s Advantages? Joomla is an open-source CMS,...

Failure as a graphic designer
Why You’re Failing As A Graphic Designer

Failing As A Graphic Designer If you’ve ever tried starting your...

LittleSoul
75 Clean WordPress Blog Themes

Pick the Right WordPress Blog Theme for You WordPress has come...

photography-wordpress-themes-feat
10 Best Photography WordPress Themes

10 Best Photography WordPress Themes That Make Your Heart Beat Faster...

free-wp-feat
Top 20 Free and Premium WordPress Themes to Refresh Your Website

Free and Premium WordPress Themes Wait a minute, you say. Have...

refreshing-WordPress-themes
20 Refreshing WordPress Themes for Autumn

20 Refreshing WordPress Themes Seasons come one after another, and, fortunately,...