'',
'default-text-color' => '000',
'width' => 960,
'height' => 200,
'flex-height' => true,
'wp-head-callback' => 'comet_header_style',
'admin-head-callback' => 'comet_admin_header_style',
'admin-preview-callback' => 'comet_admin_header_image',
) ) );
load_theme_textdomain( 'comet', get_template_directory() . '/languages' );
register_nav_menus( array(
'primary-menu' => __( 'Above Title', 'comet' ),
'secondary-menu' => __( 'Below Title', 'comet' ),
) );
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
add_action( 'init', 'comet_register_styles' );
add_action( 'widgets_init', 'comet_register_sidebars' );
add_action( 'wp_enqueue_scripts', 'comet_enqueue_color_style' );
add_filter( 'body_class', 'comet_body_class' );
}
}
add_action( 'after_setup_theme', 'comet_setup' );
/**
* Enqueue scripts and styles
*/
function comet_scripts() {
global $wp_styles;
wp_enqueue_style( 'comet', get_stylesheet_uri() );
wp_enqueue_style( 'comet-ie', get_template_directory_uri() . '/ie.css', array( 'comet' ) );
$wp_styles->add_data( 'comet-ie', 'conditional', 'lte IE 9' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'comet_scripts' );
if ( ! function_exists( 'comet_header_style' ) ) {
/**
* Public styles the header image and text.
*/
function comet_header_style() {
if ( HEADER_TEXTCOLOR == get_header_textcolor() && '' == get_header_image() )
return;
?>
Header admin panel.
*
*/
function comet_admin_header_style() {
?>
Header admin panel.
*
*/
function comet_admin_header_image() { ?>
__( 'Primary Sideber', 'comet' ),
'id' => 'sidebar-1',
'description' => $primary_description,
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Secondary Sidebar', 'comet' ),
'id' => 'sidebar-2',
'description' => $secondary_description,
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
}
if ( ! function_exists( 'comet_comments' ) ) {
/**
* Display a Comment.
*
* Used as callback to wp_list_comments() in comments.php
*/
function comet_comments( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
id="comment-">
$depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
id="comment-">
'grey',
'theme_layout' => 'content-sidebar',
);
return apply_filters( 'comet_default_theme_options', $defaults );
}
/**
* Get Recognized Color Schemes.
*
* @return array A list of recognized color schemes.
*/
function comet_color_schemes() {
$color_schemes = array(
'grey' => array(
'value' => 'grey',
'label' => __( 'Grey', 'comet' )
),
'red' => array(
'value' => 'red',
'label' => __( 'Red', 'comet' )
),
'yellow' => array(
'value' => 'yellow',
'label' => __( 'Yellow', 'comet' )
),
'green' => array(
'value' => 'green',
'label' => __( 'Green', 'comet' )
),
'teal' => array(
'value' => 'teal',
'label' => __( 'Teal', 'comet' )
),
'blue' => array(
'value' => 'blue',
'label' => __( 'Blue', 'comet' )
),
'purple' => array(
'value' => 'purple',
'label' => __( 'Purple', 'comet' )
),
);
return $color_schemes;
}
/**
* Get Recognized Layouts.
*
* @return array A list of recognized layouts.
*/
function comet_theme_layouts() {
$theme_layouts = array(
'content-sidebar' => array(
'value' => 'content-sidebar',
'label' => __( 'Content-Sidebar', 'comet' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/content-sidebar.png',
),
'sidebar-content' => array(
'value' => 'sidebar-content',
'label' => __( 'Sidebar-Content', 'comet' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content.png',
),
'sidebar-content-sidebar' => array(
'value' => 'sidebar-content-sidebar',
'label' => __( 'Sidebar-Content-Sidebar', 'comet' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content-sidebar.png',
),
'content' => array(
'value' => 'content',
'label' => __( 'Content', 'comet' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/content.png',
),
);
return $theme_layouts;
}
/**
* Allow WordPress "Background" UI to recognize the background color set in Comet's "Color Scheme" option.
*/
function comet_admin_background_style() {
?>
tag based on what is being viewed.
*
* @since Comet 1.0
*/
function comet_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'comet' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'comet_wp_title', 10, 2 );