Skip to main content

Genesis Developer Docs

Set Theme Settings During Activation

Requires Genesis 2.9.0+

One-click theme setup #

Set theme settings during activation #

Create a config/child-theme-settings.php file to set theme settings during activation:

<?php
/**
* Genesis Sample theme settings.
*
* Genesis 2.9+ updates these settings when themes are activated.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0-or-later
* @link https://www.studiopress.com/
*/


return [
GENESIS_SETTINGS_FIELD => [
'blog_cat_num' => 6,
'breadcrumb_home' => 0,
'breadcrumb_front_page' => 0,
'breadcrumb_posts_page' => 0,
'breadcrumb_single' => 0,
'breadcrumb_page' => 0,
'breadcrumb_archive' => 0,
'breadcrumb_404' => 0,
'breadcrumb_attachment' => 0,
'content_archive' => 'full',
'content_archive_limit' => 0,
'content_archive_thumbnail' => 0,
'image_size' => 'genesis-singular-images',
'image_alignment' => 'aligncenter',
'posts_nav' => 'numeric',
'site_layout' => 'content-sidebar',
'footer_text' => 'Default theme footer text.'
],
'posts_per_page' => 6,
];

Theme settings import is attached to the after_switch_theme hook. It runs on theme activation independently from the theme setup or starter packs selection process.