• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Genesis Snippets

A reference for Genesis theme developers

  • Home
  • Archives
  • Search Genesis Snippets

theme options

Remove Genesis layout settings for a Custom Post Type

July 29, 2012 By David Wang

If you’ve forced a layout for a custom post type, there’s no need to display the Layout Settings metabox in the edit screen. Here’s a code snippet that removes the layout options for a product custom post type.

/** Remove Genesis inpost layouts from 'product' post_type */
add_action( 'init', 'child_remove_post_type_support' );
function child_remove_post_type_support() {
	remove_post_type_support( 'product', 'genesis-layouts' );
}

Replace product with the custom post type you want this to work for.

Credit: Ade Walker, gleaned from his article How to use Genesis Connect for WooCommerce.

Want to remove the default layout metabox in the Genesis Theme Settings page instead? Use this snippet: Remove unused theme settings metaboxes

Filed Under: Genesis Tagged With: custom post type, metabox, page layouts, theme options

Define Genesis default options

March 20, 2012 By David Wang

Define preset options for Genesis child themes so that when activated, you don’t need to muck around the Theme Settings page.

/** Define Genesis Options */
add_filter('genesis_options', 'define_genesis_setting_custom', 10, 2);
function define_genesis_setting_custom($options, $setting) {
    if($setting == GENESIS_SETTINGS_FIELD) {
        $options['show_info'] = 0; // Display theme info in document source
        $options['update'] = 1; // Enable Automatic Updates
        $options['update_email'] = 0; // Notify when updates are available
        $options['update_email_address'] = ''; // Update email address
        $options['feed_uri'] = ''; // Custom reed URI
        $options['redirect_feed'] = 0; // Redirect reed
        $options['comments_feed_uri'] = ''; // Custom comments feed URI
        $options['redirect_comments_feed'] = 0; // Redirect feed
        $options['site_layout'] = 'content-sidebar'; // Default layout
        $options['blog_title'] = 'text'; // Blog title/logo - 'text' or 'image'
        $options['nav'] = 1; // Include primary navigation
        $options['nav_superfish'] = 1; // Enable fancy dropdowns
        $options['nav_extras_enable'] = 0; // Enable extras
        $options['nav_extras'] = 'date'; // Extras - 'date', 'rss', 'search', 'twitter'
        $options['nav_extras_twitter_id'] = ''; // Twitter ID
        $options['nav_extras_twitter_text'] = 'Follow me on Twitter'; // Twitter link text
        $options['subnav'] = 0; // Include secondary navigation
        $options['subnav_superfish'] = 1; // Enable fancy dropdowns
        $options['breadcrumb_home'] = 1; // Enable breadcrumbs on Front Page
        $options['breadcrumb_single'] = 1; // Enable breadcrumbs on Posts
        $options['breadcrumb_page'] = 1; // Enable breadcrumbs on Pages
        $options['breadcrumb_archive'] = 1; // Enable breadcrumbs on Archives
        $options['breadcrumb_404'] = 1; // Enable breadcrumbs on 404 Page
        $options['breadcrumb_attachment'] = 1; // Enable breadcrumbs on Attachment Pages
        $options['comments_posts'] = 1; // Enable comments on Posts
        $options['comments_pages'] = 0; // Enable comments on Pages
        $options['trackbacks_posts'] = 1; // Enable trackbacks on Posts
        $options['trackbacks_pages'] = 0; // Enable trackbacks on Pages
        $options['content_archive'] = 'full'; // Content archives display - 'full', 'excerpts'
        $options['content_archive_limit'] = ''; // Limit content to n characters
        $options['content_archive_thumbnail'] = 0; // Include featured image
        $options['posts_nav'] = 'older-newer'; // Post navigation - 'older-newer', 'prev-next', 'numeric'
        $options['blog_cat'] = '0'; // Blog page displays which category
        $options['blog_cat_exclude'] = ''; // Blog page excludes which category 
        $options['blog_cat_num'] = 10; // Number of posts to show
        $options['header_scripts'] = ''; // Header scripts
        $options['footer_scripts'] = ''; // Footer scripts
        }
    return $options;
}

Updated from Christopher Cochran

Filed Under: Genesis Tagged With: theme options

Remove unused page layouts

March 20, 2012 By David Wang

Genesis comes with 6 page layouts, which you may not need for every site. Here’s how to remove them.

/** Remove Unused Page Layouts */
// Un-comment the page layouts you wish to remove
//genesis_unregister_layout( 'full-width-content' );
//genesis_unregister_layout( 'content-sidebar' );	
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );

Credit: Bill Erickson

Filed Under: Genesis Tagged With: page layouts, theme options

Remove unused theme settings metaboxes

March 20, 2012 By David Wang

Hide the Header, Navigation, Breadcrumb and Blog Page settings in the Genesis Theme Settings page. Uncomment the corresponding lines for the metaboxes you want to remove

/** Remove unused theme settings */
add_action( 'genesis_theme_settings_metaboxes', 'child_remove_metaboxes' );
function child_remove_metaboxes( $_genesis_theme_settings_pagehook ) {
	remove_meta_box( 'genesis-theme-settings-header', $_genesis_theme_settings_pagehook, 'main' );
	remove_meta_box( 'genesis-theme-settings-nav', $_genesis_theme_settings_pagehook, 'main' );
	remove_meta_box( 'genesis-theme-settings-layout', $_genesis_theme_settings_pagehook, 'main' );
	remove_meta_box( 'genesis-theme-settings-breadcrumb', $_genesis_theme_settings_pagehook, 'main' );
//	remove_meta_box( 'genesis-theme-settings-comments', $_genesis_theme_settings_pagehook, 'main' );
//	remove_meta_box( 'genesis-theme-settings-blogpage', $_genesis_theme_settings_pagehook, 'main' );
}

Updated from Bill Erickson

Tip: Use this in conjunction with defining default theme options so that old settings are not stuck with the old values.

Filed Under: Genesis Tagged With: theme options

Force Superfish menus

March 20, 2012 By David Wang

Force the Superfish script to be activated on navigation menus using the genesis_pre_get_option_ filter.

add_filter( 'genesis_pre_get_option_nav_superfish', 'nrp_get_option_nav_superfish' );
function nrp_get_option_nav_superfish( $opt ) {
	$opt = '1';
	return $opt;
}

Tip: Use this in conjunction with removing unused theme settings metaboxes so that users are not confused with why their settings are not being saved.

Filed Under: Genesis Tagged With: menu, navigation, theme options

Force navigation menu display

March 20, 2012 By David Wang

Force the primary menu to be displayed using the genesis_pre_get_option_ filter.

add_filter( 'genesis_pre_get_option_nav', 'child_get_option_nav' );
function child_get_option_nav( $opt ) {
	$opt = '1';
	return $opt;
}

Tip: Use this in conjunction with removing unused theme settings metaboxes so that users are not confused with why their settings are not being saved.

Filed Under: Genesis Tagged With: menu, navigation, theme options

Primary Sidebar

Brought to you by ClickWP
Buy the Genesis Theme Framework

Who’s behind this?

Hi! I'm David and I'm a big Genesis fan. I've been using it in all my projects and have found it to be super powerful.

I started this site to keep track of all the snippets that I've been using in my projects and so that it's easy for me to find them again instead of digging through my old project files.

Help support this site by buying Genesis with our affiliate links. Thanks!

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 354 other subscribers

Browse Snippets

branding cache comments css custom post type doctype entry footer entry header favicon featured image genesis_custom_loop images internet explorer jetpack loop media menu metabox minify navigation oembed page layouts performance plugin integration post thumbnail shortcode sidebars theme options widget areas widgets WooCommerce WordPress
Everything you need to support your online business
Take WordPress further with the Genesis framework

Copyright © 2025 · Genesis Sample On Genesis Framework · WordPress · Log in