[Genesis Framework] How to change the display position of the navigation menu

In Genesis Framework, navigation menus are basically installed in the following two places.

Header: Primary navigation menu
Footer: Secondary navigation menu

Here's how to display the secondary navigation menu displayed in the footer at the top right of the header.

How to change the secondary menu display position

As an example, we will use the child theme "Genesis Sample" that comes with the purchase of the Genesis framework.By default, there is only one line for the primary menu, but the position of the footer menu is set to two lines by setting it on the header.

Genesis Sample default menu
Default menu
Customized Genesis Sample menu
Customized menu

1. Open the WordPress administration screen → "Appearance" → "Theme Editor".

2. Next, select the genesis child theme you want to edit and open function.php.
(Back up function.php by downloading it separately in case editing fails)

3. I think I have the following code

// Repositions the secondary navigation menu. remove_action ('genesis_after_header','genesis_do_subnav'); add_action ('genesis_footer','genesis_do_subnav', 10);

4. Replace with the following code and update.

// Change the position of the secondary menu remove_action ('genesis_after_header','genesis_do_subnav'); add_action ('genesis_before_header','genesis_do_subnav');

Add the following code to the additional CSS.

/ * Right justify the menu * / .nav-secondary {margin: .3em 2em; text-align: right;}

that's all.

The class name is .nav-secondary, but if the name differs depending on the child theme, right-click on google chrome → verify.