You could do something like what Genesis child themes include to save default theme settings when activating and switching themes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | //* Theme Setting Defaults add_filter( 'genesis_theme_settings_defaults', 'child_theme_defaults' ); function child_theme_defaults( $defaults ) { $defaults['blog_cat_num'] = 6; $defaults['content_archive'] = 'full'; $defaults['content_archive_limit'] = 150; $defaults['content_archive_thumbnail'] = 0; $defaults['image_alignment'] = ''; $defaults['image_size'] = 'entry-image'; $defaults['posts_nav'] = 'prev-next'; $defaults['site_layout'] = 'full-width-content'; return $defaults; } //* Theme Setup add_action( 'after_switch_theme', 'child_theme_setting_defaults' ); function child_theme_setting_defaults() { if( function_exists( 'genesis_update_settings' ) ) { genesis_update_settings( array( 'blog_cat_num' => 6, 'content_archive' => 'full', 'content_archive_limit' => 150, 'content_archive_thumbnail' => 0, 'image_alignment' => '', 'image_size' => 'entry-image', 'posts_nav' => 'prev-next', 'site_layout' => 'full-width-content', ) ); } else { _genesis_update_settings( array( 'blog_cat_num' => 6, 'content_archive' => 'full', 'content_archive_limit' => 150, 'content_archive_thumbnail' => 0, 'image_alignment' => '', 'image_size' => 'entry-image', 'posts_nav' => 'prev-next', 'site_layout' => 'full-width-content', ) ); |
Clearly you would need to modify this code to work with your themes functionality.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.