$args ){ if( !empty( $args ) ){ add_theme_support( $key, $args ); } else{ add_theme_support( $key ); } } /** * Custom Images Sizes */ $cfgs = apply_filters( 'gourmand_images_sizes', (array)gourmand_config::get( 'images-sizes' ) ); foreach( $cfgs as $id => $size ){ if( !(isset( $size[ 'width' ] ) && absint( $size[ 'width' ] ) > 0) ) continue; if( !(isset( $size[ 'height' ] ) && absint( $size[ 'height' ] ) > 0) ) continue; $width = $size[ 'width' ]; $height = $size[ 'height' ]; $crop = isset( $size[ 'crop' ] ) && (bool)$size[ 'crop' ]; // add custom image size add_image_size( esc_attr( $id ), absint( $width ), absint( $height ), (bool)$crop ); } set_post_thumbnail_size( 1057, 595 ); /** * Internationalizations and Localization */ load_theme_textdomain( 'gourmand' , get_template_directory() . '/languages' ); } add_action( 'after_setup_theme', 'gourmand_setup_theme' ); /** * Register Menus */ function gourmand_register_menus() { $cfgs = apply_filters( 'gourmand_register_menus', (array)gourmand_config::get( 'menus' ) ); if( !empty( $cfgs ) ) register_nav_menus( $cfgs ); } add_action( 'init', 'gourmand_register_menus' ); /** * Register Sidebars */ function gourmand_register_sidebars() { $cfgs = apply_filters( 'gourmand_register_sidebars', (array)gourmand_config::get( 'sidebars' ) ); if( !empty( $cfgs ) ){ foreach( $cfgs as $sides => $sidebars ){ foreach( $sidebars as $id => $sidebar ){ register_sidebar( $sidebar ); } } } } add_action( 'widgets_init', 'gourmand_register_sidebars' ); function gourmand_custom_styles() { gourmand_template::partial( 'templates/head/ie' ); gourmand_template::partial( 'templates/head/style' ); gourmand_template::partial( 'templates/head/hyphens' ); } add_action( 'wp_head', 'gourmand_custom_styles' ); /** * Enqueue Scripts and Styles */ add_action( 'admin_enqueue_scripts', array( 'gourmand_scripts', 'backend' ) ); add_action( 'wp_enqueue_scripts', array( 'gourmand_scripts', 'frontend' ), 0 ); add_action( 'in_admin_footer', array( 'gourmand_scripts', 'admin_footer' ) ); add_action( 'wp_footer', array( 'gourmand_scripts', 'footer' ), 0 ); ?>