array( "name" => explorer_string( 'sidebar_primary_name' ), "description" => "" ), ); add_theme_support( 'tamatebako-sidebars', $sidebars_args ); /* === Register Menus === */ $menus_args = array( "home" => explorer_string( 'home_nav_name' ), ); add_theme_support( 'tamatebako-menus', $menus_args ); /* === Load Stylesheet === */ $style_args = array( 'theme-open-sans-font', 'dashicons', 'style' //'theme-reset', //'theme', //'media-queries', //'debug-media-queries' ); if ( is_child_theme() ){ $style_args = array(); $style_args[] = 'parent'; $style_args[] = 'style'; } add_theme_support( 'hybrid-core-styles', $style_args ); /* === Editor Style === */ $editor_css = array( tamatebako_google_open_sans_font_url(), 'css/reset.min.css', 'css/editor.css' ); add_editor_style( $editor_css ); /* === Customizer Mobile View === */ add_theme_support( 'tamatebako-customize-mobile-view' ); /* === Custom Background === */ $custom_bg_args = array( 'default-color' => 'f1f1f1', 'default-image' => get_template_directory_uri() . '/images/background.jpg', 'default-repeat' => 'no-repeat', 'default-position-x' => 'center', 'default-attachment' => 'fixed', ); add_theme_support( 'custom-background', $custom_bg_args ); /* === Set Content Width === */ hybrid_set_content_width( 610 ); /* === Customizer Option === */ add_action( 'customize_register', 'explorer_customizer_register' ); /* Body Class */ add_action( 'body_class', 'explorer_body_class' ); } /** * Get Post Type Name * @since 1.0.0 */ function explorer_get_post_type_name( $id = '' ){ if( !$id ){ $id = get_the_ID(); } $name = ''; $cpt = get_post_type_object( get_post_type( $id ) ); if( isset( $cpt->labels->name ) ){ $name = $cpt->labels->name; } return $name; } /** * Customizer Options * @since 1.0.0 */ function explorer_customizer_register( $wp_customize ){ /* === BACKGROUND === */ /* Full size bg setting */ $wp_customize->add_setting( 'full_size_background', array( 'default' => 0, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'explorer_sanitize_checkbox', )); /* add it in background image section */ $wp_customize->add_control( 'explorer_full_size_background', array( 'settings' => 'full_size_background', 'section' => 'background_image', 'label' => explorer_string( 'full_size_background' ), 'type' => 'checkbox', 'priority' => 20, )); } /** * Add Body Class * @since 1.0.0 */ function explorer_body_class( $classes ){ /* full size background */ if ( explorer_sanitize_checkbox( get_theme_mod( 'full_size_background', '' ) ) ){ $classes[] = 'full-size-background'; } return $classes; } /** * Utillity: Sanitize Checkbox * @since 1.0.0 */ function explorer_sanitize_checkbox( $input ){ if ( isset($input) && !empty($input) ){ return true; } return false; } /** * Home Navigation Walker * @link http://wpbeg.in/V8Sa8i * @since 1.0.0 */ class Explorer_Home_Navigation extends Walker_Nav_Menu { function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . '"'; $output .= $indent . '