'f7f7f7',
'border' => 'f2f2f2',
'text' => '242424',
'link' => '333333',
'url' => '4a630f',
);
// Calculate content_width based on layout option
$content_width = 630;
if ( 'three-column sidebar-content-sidebar' == zbench_current_layout() )
$content_width = 472;
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since zBench 1.0
*/
function zbench_setup() {
/**
* Make theme available for translation
* Translations can be filed in the /languages/ directory
* If you're building a theme based on zBench, use a find and replace
* to change 'zbench' to the name of your theme in all the template files
*/
load_theme_textdomain( 'zbench', get_template_directory() . '/languages' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu', 'zbench' ),
) );
// This theme allows users to set a custom background
add_theme_support( 'custom-background' );
// This theme allows users to add a custom image header
add_theme_support( 'custom-header', apply_filters( 'zbench_custom_header_args', array(
'default-text-color' => '222',
'width' => 960,
'height' => 200,
'wp-head-callback' => 'zbench_header_style',
'admin-head-callback' => 'zbench_admin_header_style',
'admin-preview-callback' => 'zbench_admin_header_image',
) ) );
// Add feed links to the head section
add_theme_support( 'automatic-feed-links' );
}
add_action( 'after_setup_theme', 'zbench_setup' );
/**
* Included in the site head for custom headers
*
* @since zBench 1.0
*/
function zbench_header_style() { ?>
Header admin panel.
*
* @since zBench 1.0
*/
function zbench_admin_header_image() {
$style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
$header = get_header_image();
?>
__( 'Primary Widget Area', 'zbench' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
// Registers Secondary Widget Area
register_sidebar(
array (
'name' => __( 'Secondary Widget Area', 'zbench' ),
'id' => 'secondary-widget-area',
'description' => __( 'The primary widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
// Registers Featured Widget Area
register_sidebar(
array (
'name' => __( 'Featured Widget Area', 'zbench' ),
'id' => 'featured-widget-area',
'description' => __( 'The featured widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
// Registers First Footer Widget Area
register_sidebar(
array (
'name' => __( 'First Footer Widget Area', 'zbench' ),
'id' => 'first-footer-widget-area',
'description' => __( 'The first footer widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
// Registers Second Footer Widget Area
register_sidebar(
array (
'name' => __( 'Second Footer Widget Area', 'zbench' ),
'id' => 'second-footer-widget-area',
'description' => __( 'The second footer widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
// Registers Third Footer Widget Area
register_sidebar(
array (
'name' => __( 'Third Footer Widget Area', 'zbench' ),
'id' => 'third-footer-widget-area',
'description' => __( 'The third footer widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
// Registers Fourth Footer Widget Area
register_sidebar(
array (
'name' => __( 'Fourth Footer Widget Area', 'zbench' ),
'id' => 'fourth-footer-widget-area',
'description' => __( 'The fourth footer widget area', 'zbench' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
);
}
add_action( 'widgets_init', 'zbench_widgets_init' );
/**
* Get current theme options with defaults as fallback
*/
function zbench_get_theme_options() {
$defaults = array(
'theme_layout' => 'content-sidebar',
);
$options = get_option( 'zbench_theme_options', $defaults );
return $options;
}
/**
* Returns the current zBench layout as selected in the theme options
*
* @since zBench 1.0
*/
function zbench_current_layout() {
$options = zbench_get_theme_options();
$current_layout = $options['theme_layout'];
$two_columns = array( 'content-sidebar', 'sidebar-content' );
if ( in_array( $current_layout, $two_columns ) )
return 'two-column ' . $current_layout;
else
return 'three-column ' . $current_layout;
}
/**
* Adds zbench_current_layout() to the array of body classes
*
* @since zBench 1.0
*/
function zbench_body_class($classes) {
$classes[] = zbench_current_layout();
return $classes;
}
add_filter( 'body_class', 'zbench_body_class' );
/**
* Add class attributes to the first
'; /* Display the comment itself */ ?>