'ffffff', 'text' => '000000', 'link' => '2E6EB0', 'border' => 'CCCCCC', 'url' => '000000', ); } /** * Theme setup */ if ( ! function_exists( 'blaskan_setup' ) ): function blaskan_setup() { global $content_width; $_content_width = $_header_width = 540; add_theme_support( 'automatic-feed-links' ); add_theme_support( 'custom-background' ); // Set up widths for each layout. if ( is_active_sidebar( 'primary-sidebar' ) && is_active_sidebar( 'secondary-sidebar' ) ) { // 3-column layout $_header_width = 1120; } elseif ( is_active_sidebar( 'primary-sidebar' ) || is_active_sidebar( 'secondary-sidebar' ) ) { // 2-column layout $_content_width = 830; $_header_width = 1120; } if ( ! isset( $content_width ) || 0 == $content_width ) $content_width = $_content_width; // Post thumbnails add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( $_content_width, 999, true ); // Add support for custom header. add_theme_support( 'custom-header', array( // The default header text color. 'default-text-color' => '000', // The height and width of our custom header. 'width' => apply_filters( 'blaskan_header_image_width', $_header_width ), 'height' => apply_filters( 'blaskan_header_image_height', 160 ), // Callback for styling the header. 'wp-head-callback' => 'blaskan_header_style', // Callback for styling the header preview in the admin. 'admin-head-callback' => 'blaskan_admin_header_style', // Callback used to display the header preview in the admin. 'admin-preview-callback' => 'blaskan_admin_header_image', ) ); // Add two custom menu locations. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'blaskan' ), 'footer' => __( 'Footer Navigation', 'blaskan' ), ) ); load_theme_textdomain( 'blaskan', get_template_directory() . '/languages' ); } endif; add_action( 'after_setup_theme', 'blaskan_setup' ); /** * JS init */ if ( ! function_exists( 'blaskan_js_init' ) ): function blaskan_js_init() { wp_enqueue_style( 'blaskan', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'blaskan', get_template_directory_uri() . '/js/script.js', array( 'jquery' ), '20120303' ); wp_localize_script( 'blaskan', 'objectL10n', array( 'blaskan_navigation_title' => __( '- Navigation -', 'blaskan' ) ) ); } endif; add_action( 'wp_enqueue_scripts', 'blaskan_js_init' ); /** * Register widget areas. All are empty by default. */ if ( ! function_exists( 'blaskan_widgets_init' ) ): function blaskan_widgets_init() { // Primary sidebar register_sidebar( array( 'name' => __( 'Primary Widget Area', 'blaskan' ), 'id' => 'primary-sidebar', 'description' => __( 'The primary sidebar', 'blaskan' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); // Secondary sidebar register_sidebar( array( 'name' => __( 'Secondary Widget Area', 'blaskan' ), 'id' => 'secondary-sidebar', 'description' => __( 'The secondary sidebar', 'blaskan' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); // Footer widgets register_sidebar( array( 'name' => __( 'Footer Widget Area', 'blaskan' ), 'id' => 'footer-widget-area', 'description' => __( 'The footer widget area', 'blaskan' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } endif; add_action( 'widgets_init', 'blaskan_widgets_init' ); /** * Add body classes */ if ( ! function_exists( 'blaskan_body_class' ) ): function blaskan_body_class( $classes ) { if ( get_theme_mod( 'background_image' ) || get_theme_mod( 'background_color' ) ) { $classes[] = 'background-image'; if ( get_theme_mod( 'background_color' ) == 'FFFFFF' || get_theme_mod( 'background_color' ) == 'FFF' ) { $classes[] = 'background-white'; } } if ( get_theme_mod( 'header_image' ) ) { $classes[] = 'header-image'; } $nav = wp_nav_menu( array( 'theme_location' => 'primary', 'echo' => false, 'container' => false ) ); $nav_links = substr_count( $nav, ' Header admin panel. * * */ function blaskan_admin_header_style() { ?> Header admin panel. * * */ function blaskan_admin_header_image() { ?>

onclick="return false;" href="">

>
'.esc_attr( get_bloginfo( 'name', 'display' ) ).''; endif; $output .= '

'.get_bloginfo( 'name' ).'

'; $output .= '
' . get_bloginfo( 'description', 'display' ) . '
'; $output .= blaskan_primary_nav(); return $output; } endif; /** * Returns primary nav */ if ( ! function_exists( 'blaskan_primary_nav' ) ): function blaskan_primary_nav() { $nav = wp_nav_menu( array( 'theme_location' => 'primary', 'echo' => false, 'container' => false ) ); // Check nav for links if ( strpos( $nav, '' . $nav_prepend . $nav . $nav_append . ''; } else { return; } } endif; if ( ! function_exists( 'blaskan_comment' ) ) : function blaskan_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : ?>
  • id="comment-">
    %s', get_comment_author_link() ); ?>
    comment_approved == '0' ) : ?>

    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ' . $avatar . ''; } else { return; } } endif; /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Blaskan 2.4.2 */ function blaskan_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', 'blaskan' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'blaskan_wp_title', 10, 2 );