Display Nav Menu in Genesis Footer

There’s different ways and locations you can display navigation menu’s anywhere in Genesis.

With Genesis its very easy as all you need to do:

  • Create a new nav menu or use an existing one
  • Add code to your child themes functions.php file

Create A Navigation Menu

Go to Appearance > Menu’s and create a new menu.

Select the menu in your Theme Locations.

Create Menu

You’ll also need to go to your Genesis Theme Settings and enable the Primary or Secondary Menu depending on which you want to display in your footer area. If you haven’t already done so.

Theme Settings Navigation

CODE

Simply paste one of these code snippets into your child themes functions.php file.

Choose from before, after or in replace of your footer.

Display Second Nav Menu After Footer

/** secondary nav menu after footer */
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_after_footer', 'genesis_do_subnav' );

Remove Footer & Display Second Nav Menu

/** secondary nav menu in footer*/
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_footer', 'genesis_do_subnav' );

Display Second Nav Menu Before Footer

/** secondary nav menu before footer*/
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_before_footer', 'genesis_do_subnav' );

Display Primary Nav Menu After Footer

/** Primary nav menu after footer */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_after_footer', 'genesis_do_nav' );

Remove Footer & Display Primary Nav Menu

/** Primary nav menu in footer */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_footer', 'genesis_do_nav' );

Display Primary Nav Menu Before Footer

/** Primary nav menu before footer */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_footer', 'genesis_do_nav' );

Displaying Nav Menus Using Genesis Simple Hooks Plugin

You can also paste this code into any hook area using (Genesis Simple Hooks Plugin) you want to display your nav menu.

footer code genesis

Display Nav Menu Based On Conditions

You may need to also add a conditional statement if you don’t want the menu displayed in your archive pages.

The conditional tag depends on the location but you won’t need to add one if its the footer or header area’s.

Using conditional tags enables you to display your nav menu anywhere there’s a hook but also depending on certain conditions like:

  • Only on the home page is_home ()
  • Only on single posts is_single ()
  • Only on a specific page is_page ( 42 )

I’ll be writing more about how to display a custom navigation menu using conditional tags shortly.

Other Options


Comments

9 responses to “Display Nav Menu in Genesis Footer”

  1. Thanks for sharing this useful code. Using this code will cut down a plugin.

    1. Brad Dalton Avatar
      Brad Dalton

      No worries Manish

  2. Karissa Avatar

    What about if you want to use a third menu, not the primary or secondary, for in the footer? How would you do that?

    Or if I wanted to use 4th menu on a landing page?

    1. Brad Dalton Avatar
      Brad Dalton

      Hi Karissa

      There’s at least 3 ways to do that.

      You could register a new widget area conditionally and use the custom menu widget.

      You could use custom code to conditionally change the menu which i have written about already.

      You could register a 3rd and 4th menu location and assign any menu to them.

  3. Thanks for this tutorial Brad – exactly what I was after!

  4. Dirk Leeward Avatar
    Dirk Leeward

    Should this work with Genesis Simple Hooks and Genesis child themes? Doesn’t for me.

    1. Brad Dalton Avatar
      Brad Dalton

      The code is tested and works.

      Paste it at the end of your child themes functions.php file using a text editor like Notepad++.

      Why would you use Simple hooks when you can use your child themes functions file?

      The code used in Simple hooks won’t work in custom functions unless you remove the php tags and vise versa.

      This code is written to work in your functions.php file

      No one writes code for simple hooks.

  5. chandra Avatar

    Thanks dude for amazing tutorial..

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.