'fff',
'border' => 'eeeeee',
'text' => '444444',
'link' => '9c8a6a',
'url' => '9c8a6a'
);
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 500; /* pixels */
/**
* Tell WordPress to setup Manifest when the 'after_setup_theme' hook is run.
*/
add_action( 'after_setup_theme', 'manifest_setup' );
function manifest_setup() {
/**
* Add default posts and comments RSS feed links to head
*/
add_theme_support( 'automatic-feed-links' );
/**
* Add support for the Aside and Gallery Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'status', 'gallery' ) );
/**
* Manifest uses wp_nav_menu() in one location.
*/
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'manifest' ),
) );
add_theme_support( 'print-style' );
load_theme_textdomain( 'manifest', get_template_directory() . '/languages' );
}
function manifest_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'manifest_custom_header_args', array(
'default-image' => '',
'default-text-color' => '',
'header-text' => false,
'width' => 500,
'height' => 160,
'admin-head-callback' => 'manifest_admin_header_style',
) ) );
}
add_action( 'after_setup_theme', 'manifest_custom_header_setup' );
/**
* Enqueue scripts and styles
*/
function manifest_scripts() {
global $wp_styles;
wp_enqueue_style( 'manifest', get_stylesheet_uri() );
wp_enqueue_style( 'manifest-ie', get_template_directory_uri() . '/css/style_ie.css', array( 'manifest' ) );
$wp_styles->add_data( 'manifest-ie', 'conditional', 'IE 7' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'manifest_scripts' );
/**
* Get our wp_nav_menu() fallback, wp_page_menu().
*/
function manifest_page_menu() { // fallback for primary navigation ?>
Header admin panel.
*/
function manifest_admin_header_style() {
?>
__( 'Footer area one', 'manifest' ),
'id' => 'sidebar-1',
'description' => __( 'An optional widget area for your site footer', 'manifest' ),
'before_widget' => '",
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer area two', 'manifest' ),
'id' => 'sidebar-2',
'description' => __( 'An optional widget area for your site footer', 'manifest' ),
'before_widget' => '",
'before_title' => '',
) );
}
add_action( 'widgets_init', 'manifest_widgets_init' );
/**
* Count the number of footer sidebars to enable dynamic classes for the footer
*/
function manifest_footer_sidebar_class() {
$count = 0;
if ( is_active_sidebar( 'sidebar-1' ) )
$count++;
if ( is_active_sidebar( 'sidebar-2' ) )
$count++;
$class = '';
switch ( $count ) {
case '1':
$class = 'one';
break;
case '2':
$class = 'two';
break;
}
if ( $class )
echo 'class="' . $class . '"';
}
/**
* Grab the first URL from a Link post
*/
function manifest_url_grabber() {
if ( ! preg_match( '/]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
return false;
return esc_url_raw( $matches[1] );
}
/**
* Adds custom classes to the array of body classes.
*/
function manifest_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
return $classes;
}
add_filter( 'body_class', 'manifest_body_classes' );
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*
* @since Manifest 1.01
*/
function manifest_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', 'manifest' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'manifest_wp_title', 10, 2 );