get_template_directory_uri() . '/images/header1.png',
'random-default' => false,
'width' => 780,
'height' => 163,
'flex-height' => false,
'flex-width' => false,
'default-text-color' => 'FFFFFF',
'header-text' => false,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
add_theme_support( 'custom-header', $defaults );
/*
* Enqueue scripts and styles for front-end.
* @since TSW_Plain 2.0
* @return void
*/
function tsw_plain_scripts_styles() {
/*
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
// Loads default main stylesheet.
wp_enqueue_style( 'tsw_plain-style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'tsw_plain_scripts_styles' );
/**
* customer background color support
*/
add_theme_support( 'custom-background' );
$args = array(
'default-color' => 'FAFAFB',
'default-image' => get_template_directory_uri() . '/images/default_background.png',
);
add_theme_support( 'custom-background', $args );
/*
* Registers our main widget area and the footer widget areas.
*/
function tsw_plain_widgets_init() {
register_sidebar( array(
'name' => __('Right Side Widget', 'tsw_plain'),
'id' => 'sidebar-1',
'description' => __('Appears on posts and pages in Footer Area Left', 'tsw_plain'),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __('Footer Widget 1', 'tsw_plain'),
'id' => 'sidebar-2',
'description' => __('Appears Left Side on Footer', 'tsw_plain'),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __('Footer Widget 2', 'tsw_plain'),
'id' => 'sidebar-3',
'description' => __('Appears on Footer Middle', 'tsw_plain'),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __('Footer Widget 3', 'tsw_plain'),
'id' => 'sidebar-4',
'description' => __('Appears on Footer Right', 'tsw_plain'),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __('Right Header Logo Widget', 'tsw_plain'),
'id' => 'header-sidebar',
'description' => __('Optional Header Area Right - Max Height = 250 pixels Only 1 Widget allowed', 'tsw_plain'),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'tsw_plain_widgets_init' );
/*
* This filter sets all fonts to the same size to keep the header-widget
* contained when using tag cloud in the header-widget. Change arguments for 'smallest' 'largest'
* to use in other widgets to make font sizes various sizes. 18 and 9 are good sizes.
*/
add_filter( 'widget_tag_cloud_args', 'tsw_plain_widget_tag_cloud_args' );
function tsw_plain_widget_tag_cloud_args( $args ) {
// Your extra arguments go here
$args['number'] = 25;
$args['largest'] = 11;
$args['smallest'] = 11;
$args['unit'] = 'px';
return $args;
}
/*
* WordPress body class Extender :
* 1. Using a full-width layout without widgets.
*
* @since TSW_Plain 2.0
*/
function tsw_plain_content_width() {
if ( is_page_template( 'full-width.php' ) || is_attachment() || ! is_active_sidebar( 'tsw_plain-sidebar' ) ) {
global $content_width;
$content_width = 1040;
}
}
add_action( 'template_redirect', 'tsw_plain_content_width' );
?>