Skip to main content

Genesis Developer Docs

Import Menus During Genesis Theme Setup

Requires Genesis 2.9.0+ and WordPress 5.0.0+

One-click theme setup #

Import menu items and assign them to menus #

Use this config/onboarding.php format to create and assign menu items:

<?php
/**
* Genesis Sample.
*
* Onboarding config to load content and navigation on theme activation.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://www.studiopress.com/
*/

return [
'dependencies' => [],
'widgets' => [],
// Full content omitted for this example leaving only keys.
'content' => [
'homepage' => [],
'about' => [],
'contact' => [],
'blocks' => [],
'landing' => [],
],
'navigation_menus' => [
'primary' => [
'homepage' => [
'title' => 'Home',
],
'about' => [
'title' => 'About Us',
],
'contact' => [
'title' => 'Contact Us',
],
'blocks' => [
'title' => 'Block Examples',
],
'landing' => [
'title' => 'Landing Page',
],
],
],
];

The keys in the navigation_menus array should match those from imported content.

The primary key above denotes that menu items should be assigned to the menu area that was registered as primary via register_nav_menus().

Importing links as bare URLs is not currently supported.