__( 'Header Menu', 'graphene' ), 'secondary-menu' => __( 'Secondary Menu', 'graphene' ), 'footer-menu' => __( 'Footer Menu', 'graphene' ), ) ); // Add support for custom background global $wp_version; $args = array( 'default-color' => 'FBFBFB', 'default-image' => GRAPHENE_ROOTURI . '/images/bg.jpg', 'default-repeat' => 'no-repeat', 'default-position-x' => 'center', 'default-size' => 'contain' ); if ( $graphene_settings['container_style'] == 'boxed' ) add_theme_support( 'custom-background', $args ); /* Add support for custom header */ $header_image_width = ( $graphene_settings['container_style'] != 'boxed' ) ? 1903 : graphene_grid_width( $graphene_settings['gutter_width'] * 2, 12 ); $args = array( 'width' => apply_filters( 'graphene_header_image_width', $header_image_width ), 'height' => apply_filters( 'graphene_header_image_height', $graphene_settings['header_img_height'] ), 'default-image' => apply_filters( 'graphene_default_header_image', GRAPHENE_ROOTURI . '/images/headers/forest.jpg' ), 'header-text' => apply_filters( 'graphene_header_text', true ), 'default-text-color' => apply_filters( 'graphene_header_textcolor', 'ffffff' ), 'wp-head-callback' => '', 'admin-head-callback' => 'graphene_admin_header_style', ); $args = apply_filters( 'graphene_custom_header_args', $args ); add_theme_support( 'custom-header', $args ); if ( $graphene_settings['slider_as_header'] ) set_post_thumbnail_size( $content_width, 0 ); else set_post_thumbnail_size( $args['width'], $args['height'], true ); // Register default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( graphene_get_default_headers() ); /* Add responsive embeds */ add_filter( 'embed_oembed_html', 'graphene_responsive_embed', 10, 3 ); add_theme_support( 'responsive-embeds' ); /* Adds support for editor font sizes */ add_theme_support( 'custom-line-height' ); add_theme_support( 'editor-font-sizes', array( array( 'name' => __( 'Tiny', 'graphene' ), 'shortName' => __( 'XS', 'graphene' ), 'size' => 10, 'slug' => 'tiny' ), array( 'name' => __( 'Small', 'graphene' ), 'shortName' => __( 'S', 'graphene' ), 'size' => 14, 'slug' => 'small' ), array( 'name' => __( 'Regular', 'graphene' ), 'shortName' => __( 'M', 'graphene' ), 'size' => 16, 'slug' => 'regular' ), array( 'name' => __( 'Large', 'graphene' ), 'shortName' => __( 'L', 'graphene' ), 'size' => 20, 'slug' => 'large' ), array( 'name' => __( 'Larger', 'graphene' ), 'shortName' => __( 'XL', 'graphene' ), 'size' => 26, 'slug' => 'larger' ) ) ); do_action( 'graphene_setup' ); } endif; add_action( 'after_setup_theme', 'graphene_setup' ); if ( ! function_exists( 'graphene_get_default_headers' ) ) { function graphene_get_default_headers() { $headers = array( 'Forest' => array( 'url' => '%s/images/headers/forest.jpg', 'thumbnail_url' => '%s/images/headers/forest-thumb.jpg', 'description' => __( 'Forest', 'graphene' ), ), 'Mountains' => array( 'url' => '%s/images/headers/mountains.jpg', 'thumbnail_url' => '%s/images/headers/mountains-thumb.jpg', 'description' => __( 'Mountains', 'graphene' ), ), 'Road' => array( 'url' => '%s/images/headers/road.jpg', 'thumbnail_url' => '%s/images/headers/road-thumb.jpg', 'description' => __( 'Road', 'graphene' ), ), 'Schematic' => array( 'url' => '%s/images/headers/schematic.jpg', 'thumbnail_url' => '%s/images/headers/schematic-thumb.jpg', 'description' => __( 'Header image by Syahir Hakim', 'graphene' ) ), 'Flow' => array( 'url' => '%s/images/headers/flow.jpg', 'thumbnail_url' => '%s/images/headers/flow-thumb.jpg', 'description' => __( 'This is the default Graphene theme header image, cropped from image by Quantin Houyoux at sxc.hu', 'graphene' ) ), 'Fluid' => array( 'url' => '%s/images/headers/fluid.jpg', 'thumbnail_url' => '%s/images/headers/fluid-thumb.jpg', 'description' => __( 'Header image cropped from image by Ilco at sxc.hu', 'graphene' ) ), 'Techno' => array( 'url' => '%s/images/headers/techno.jpg', 'thumbnail_url' => '%s/images/headers/techno-thumb.jpg', 'description' => __( 'Header image cropped from image by Ilco at sxc.hu', 'graphene' ) ), 'Fireworks' => array( 'url' => '%s/images/headers/fireworks.jpg', 'thumbnail_url' => '%s/images/headers/fireworks-thumb.jpg', 'description' => __( 'Header image cropped from image by Ilco at sxc.hu', 'graphene' ) ), 'Nebula' => array( 'url' => '%s/images/headers/nebula.jpg', 'thumbnail_url' => '%s/images/headers/nebula-thumb.jpg', 'description' => __( 'Header image cropped from image by Ilco at sxc.hu', 'graphene' ) ), 'Sparkle' => array( 'url' => '%s/images/headers/sparkle.jpg', 'thumbnail_url' => '%s/images/headers/sparkle-thumb.jpg', 'description' => __( 'Header image cropped from image by Ilco at sxc.hu', 'graphene' ) ), ); return apply_filters( 'graphene_default_header_images', $headers ); } } /** * Synchronize theme mods between Graphene and Graphene Plus when switching from one to another */ function graphene_sync_theme_mods(){ $theme_slug = get_option( 'stylesheet' ); if ( stripos( $theme_slug, 'graphene' ) === false ) return; $other_theme_slug = ( $theme_slug == 'graphene' ) ? 'graphene-plus' : 'graphene'; $other_theme_mods = get_option( "theme_mods_$other_theme_slug" ); if ( $other_theme_mods ) update_option( "theme_mods_$theme_slug", $other_theme_mods ); } add_action( 'after_switch_theme', 'graphene_sync_theme_mods' ); /** * Register widgetized areas * * To override graphene_widgets_init() in a child theme, remove the action hook and add your own * function tied to the init hook. * * @since Graphene 1.0 * @uses register_sidebar */ function graphene_widgets_init() { if ( function_exists( 'register_sidebar' ) ) { global $graphene_settings, $graphene_defaults; register_sidebar(array( 'name' => __( 'Graphene - Right Sidebar', 'graphene' ), 'id' => 'sidebar-widget-area', 'before_widget' => '
', 'before_title' => '