Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set default genesis theme settings
<?php
/**
* Set default Genesis Theme Options
*
* @author Joshua David Nelson, josh@joshuadnelson.com
*/
add_filter( 'genesis_theme_settings_defaults', 'jdn_theme_settings' );
function jdn_theme_settings( $defaults ) {
$defaults = array(
'update' => 1,
'blog_title' => 'text',
'header_right' => 0,
'site_layout' => genesis_get_default_layout(),
'superfish' => 0,
'nav_extras' => '',
'nav_extras_twitter_id' => '',
'nav_extras_twitter_text' => __( 'Follow me on Twitter', 'genesis' ),
'feed_uri' => '',
'comments_feed_uri' => '',
'redirect_feeds' => 0,
'comments_pages' => 0,
'comments_posts' => 1,
'trackbacks_pages' => 0,
'trackbacks_posts' => 1,
'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_thumbnail' => 0,
'posts_nav' => 'older-newer',
'blog_cat' => '',
'blog_cat_exclude' => '',
'blog_cat_num' => 10,
'header_scripts' => '',
'footer_scripts' => '',
'theme_version' => PARENT_THEME_VERSION,
'db_version' => PARENT_DB_VERSION,
);
return $defaults;
}
@joshuadavidnelson

This comment has been minimized.

Show comment
Hide comment
@joshuadavidnelson

joshuadavidnelson Oct 24, 2014

This shows everything, you would set a specific default with something like this:

add_filter( 'genesis_theme_seetings_defaults', 'jdn_theme_settings' );
function jdn_theme_settings( $defaults ) {
    $defaults['site_layout'] = 'content-sidebar'; // set the default layout
    return $defaults;
}
Owner

joshuadavidnelson commented Oct 24, 2014

This shows everything, you would set a specific default with something like this:

add_filter( 'genesis_theme_seetings_defaults', 'jdn_theme_settings' );
function jdn_theme_settings( $defaults ) {
    $defaults['site_layout'] = 'content-sidebar'; // set the default layout
    return $defaults;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment