__( 'Header Menu', 'blograzzi' ), 'secondary-menu' => __( 'Secondary Menu', 'blograzzi' ), 'footer-menu' => __( 'Footer Menu', 'blograzzi' ), ) ); // Add support for custom background global $wp_version; $args = array( 'default-color' => 'FBFBFB', 'default-image' => BLOGRAZZI_ROOTURI . '/images/bg.jpg', 'default-repeat' => 'no-repeat', 'default-position-x' => 'center', 'default-size' => 'contain' ); if ( $blograzzi_settings['container_style'] == 'boxed' ) add_theme_support( 'custom-background', $args ); /* Add support for custom header */ define( 'HEADER_TEXTCOLOR', apply_filters( 'blograzzi_header_textcolor', 'ffffff' ) ); define( 'HEADER_IMAGE', apply_filters( 'blograzzi_default_header_image', BLOGRAZZI_ROOTURI . '/images/headers/forest.jpg' ) ); define( 'HEADER_IMAGE_WIDTH', apply_filters( 'blograzzi_header_image_width', blograzzi_grid_width( $blograzzi_settings['gutter_width'] * 2, 12 ) ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'blograzzi_header_image_height', $blograzzi_settings['header_img_height'] ) ); define( 'NO_HEADER_TEXT', ! apply_filters( 'blograzzi_header_text', true ) ); $args = array( 'width' => HEADER_IMAGE_WIDTH, 'height' => HEADER_IMAGE_HEIGHT, 'default-image' => HEADER_IMAGE, 'header-text' => ! NO_HEADER_TEXT, 'default-text-color' => HEADER_TEXTCOLOR, 'wp-head-callback' => '', 'admin-head-callback' => 'blograzzi_admin_header_style', ); $args = apply_filters( 'blograzzi_custom_header_args', $args ); add_theme_support( 'custom-header', $args ); 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( blograzzi_get_default_headers() ); do_action( 'blograzzi_setup' ); } endif; add_action( 'after_setup_theme', 'blograzzi_setup' ); if ( ! function_exists( 'blograzzi_get_default_headers' ) ) { function blograzzi_get_default_headers() { $headers = array( 'Forest' => array( 'url' => '%s/images/headers/forest.jpg', 'thumbnail_url' => '%s/images/headers/forest-thumb.jpg', 'description' => __( 'Forest', 'blograzzi' ), ), 'Mountains' => array( 'url' => '%s/images/headers/mountains.jpg', 'thumbnail_url' => '%s/images/headers/mountains-thumb.jpg', 'description' => __( 'Mountains', 'blograzzi' ), ), 'Road' => array( 'url' => '%s/images/headers/road.jpg', 'thumbnail_url' => '%s/images/headers/road-thumb.jpg', 'description' => __( 'Road', 'blograzzi' ), ), 'Schematic' => array( 'url' => '%s/images/headers/schematic.jpg', 'thumbnail_url' => '%s/images/headers/schematic-thumb.jpg', 'description' => __( 'Header image by Syahir Hakim', 'blograzzi' ) ), 'Flow' => array( 'url' => '%s/images/headers/flow.jpg', 'thumbnail_url' => '%s/images/headers/flow-thumb.jpg', 'description' => __( 'This is the default Blograzzi theme header image, cropped from image by Quantin Houyoux at sxc.hu', 'blograzzi' ) ), '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', 'blograzzi' ) ), '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', 'blograzzi' ) ), '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', 'blograzzi' ) ), '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', 'blograzzi' ) ), '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', 'blograzzi' ) ), ); return apply_filters( 'blograzzi_default_header_images', $headers ); } } /** * Register widgetized areas * * To override blograzzi_widgets_init() in a child theme, remove the action hook and add your own * function tied to the init hook. * * @since Blograzzi 1.0 * @uses register_sidebar */ function blograzzi_widgets_init() { if (function_exists( 'register_sidebar' ) ) { global $blograzzi_settings, $blograzzi_defaults; register_sidebar(array( 'name' => __( 'Blograzzi - Sidebar One', 'blograzzi' ), 'id' => 'sidebar-widget-area', 'description' => __( 'The first sidebar widget area (will always be displayed on the right hand side).', 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); register_sidebar(array( 'name' => __( 'Blograzzi - Sidebar Two', 'blograzzi' ), 'id' => 'sidebar-two-widget-area', 'description' => __( 'The second sidebar widget area (will always be displayed on the left hand side).', 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); /* Get the column settings for footer widget area */ if ( is_front_page() && $blograzzi_settings['alt_home_footerwidget'] ) $columns = $blograzzi_settings['alt_footerwidget_column']; else $columns = $blograzzi_settings['footerwidget_column']; if ( ! $columns ) $columns = $blograzzi_defaults['footerwidget_column']; if ( $columns == 6 ) $cols = 'col-md-2 col-sm-4'; else $cols = 'col-sm-' . round( 12 / $columns ); /* Register the footer widget area */ register_sidebar(array( 'name' => __( 'Blograzzi - Footer', 'blograzzi' ), 'id' => 'footer-widget-area', 'description' => __( "The footer widget area. Leave empty to disable. Set the number of columns to display at the theme's Display Options page.", 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); /** * Register alternate widget areas to be displayed on the front page, if enabled * * @package Blograzzi * @subpackage Blograzzi * @since Blograzzi 1.0.8 */ if ( $blograzzi_settings['alt_home_sidebar']) { register_sidebar( array( 'name' => __( 'Blograzzi - Sidebar One (Front Page)', 'blograzzi' ), 'id' => 'home-sidebar-widget-area', 'description' => __( 'The first sidebar widget area that will only be displayed on the front page.', 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); register_sidebar(array( 'name' => __( 'Blograzzi - Sidebar Two (Front Page)', 'blograzzi' ), 'id' => 'home-sidebar-two-widget-area', 'description' => __( 'The second sidebar widget area that will only be displayed on the front page.', 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); } if ( $blograzzi_settings['alt_home_footerwidget']) { register_sidebar(array( 'name' => __( 'Blograzzi - Footer (Front Page)', 'blograzzi' ), 'id' => 'home-footer-widget-area', 'description' => __( "The footer widget area that will only be displayed on the front page. Leave empty to disable. Set the number of columns to display at the theme's Display Options page.", 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); } /* Header widget area */ if ( $blograzzi_settings['enable_header_widget']) : register_sidebar(array( 'name' => __( 'Blograzzi - Header', 'blograzzi' ), 'id' => 'header-widget-area', 'description' => __("The header widget area.", 'blograzzi' ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", ) ); endif; /* Action hooks widget areas */ if ( count( $blograzzi_settings['widget_hooks'] ) > 0 ) { $available_hooks = blograzzi_get_action_hooks( true ); foreach ($blograzzi_settings['widget_hooks'] as $hook) { if (in_array($hook, $available_hooks)) { register_sidebar(array( 'name' => ucwords( str_replace('_', ' ', $hook) ), 'id' => $hook, 'description' => sprintf( __("Dynamically added widget area. This widget area is attached to the %s action hook.", 'blograzzi'), "'$hook'" ), 'before_widget' => '', 'before_title' => "

", 'after_title' => "

", )); // to display the widget dynamically attach the dynamic method add_action( $hook, 'blograzzi_display_dynamic_widget_hooks' ); } } } } do_action( 'blograzzi_widgets_init' ); } add_action( 'widgets_init', 'blograzzi_widgets_init' ); /** * Display a dynamic widget area, this is hooked to the user selected do_action() hooks available in Blograzzi. * @global array $blograzzi_settings */ function blograzzi_display_dynamic_widget_hooks(){ global $blograzzi_settings; // to find the current action $actionhook_id = current_filter(); if ( in_array( $actionhook_id, $blograzzi_settings['widget_hooks']) && is_active_sidebar( $actionhook_id ) ) : ?>