Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active May 23, 2019 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/5586dc563d68b947ae4d41dffb17c4d6 to your computer and use it in GitHub Desktop.
Save billerickson/5586dc563d68b947ae4d41dffb17c4d6 to your computer and use it in GitHub Desktop.
<?php
add_action( 'genesis_setup', 'utility_pro_setup', 15 );
/**
* Theme setup.
*
* Attach all of the site-wide functions to the correct hooks and filters. All
* the functions themselves are defined below this setup function.
*
* @since 1.0.0
*/
function utility_pro_setup() {
define( 'CHILD_THEME_NAME', 'utility-pro' );
define( 'CHILD_THEME_URL', 'https://store.carriedils.com/utility-pro' );
define( 'CHILD_THEME_VERSION', '1.0.0' );
// Add HTML5 markup structure.
add_theme_support( 'html5', array( 'caption', 'comment-form', 'comment-list', 'gallery', 'search-form' ) );
// Add viewport meta tag for mobile browsers.
add_theme_support( 'genesis-responsive-viewport' );
// Add support for custom background.
add_theme_support( 'custom-background', array( 'wp-head-callback' => '__return_false' ) );
// Add support for accessibility features
add_theme_support( 'genesis-accessibility', array( 'skip-links', 'headings' ) );
// Add support for three footer widget areas.
add_theme_support( 'genesis-footer-widgets', 3 );
// Add support for additional color style options.
add_theme_support(
'genesis-style-selector',
array(
'utility-pro-purple' => __( 'Purple', 'utility-pro' ),
'utility-pro-green' => __( 'Green', 'utility-pro' ),
'utility-pro-red' => __( 'Red', 'utility-pro' ),
)
);
// Add support for structural wraps (all default Genesis wraps unless noted).
add_theme_support(
'genesis-structural-wraps',
array(
'footer',
'footer-widgets',
'footernav', // Custom.
'menu-footer', // Custom.
'header',
'home-gallery', // Custom.
'nav',
'site-inner',
'site-tagline',
)
);
// Add support for two navigation areas (theme doesn't use secondary navigation).
add_theme_support(
'genesis-menus',
array(
'primary' => __( 'Primary Navigation Menu', 'utility-pro' ),
'footer' => __( 'Footer Navigation Menu', 'utility-pro' ),
)
);
// Add custom image sizes.
add_image_size( 'feature-large', 960, 330, true );
// Unregister secondary sidebar.
unregister_sidebar( 'sidebar-alt' );
// Unregister layouts that use secondary sidebar.
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
// Register the default widget areas.
utility_pro_register_widget_areas();
// Load files in admin.
if ( is_admin() ) {
// Add suggested plugins nag.
include get_stylesheet_directory() . '/includes/suggested-plugins.php';
// Add theme license (don't remove, unless you don't want theme support).
include get_stylesheet_directory() . '/includes/theme-license.php';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment