'eff1f5', 'text' => '444444', 'link' => 'ff7200', 'border' => 'c3c9d5', 'url' => '444444', ); } if ( ! function_exists( 'shaan_setup' ) ) { /** * Setup Shaan. */ function shaan_setup() { load_theme_textdomain( 'shaan', get_template_directory() . '/languages' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 100, 100, true ); add_image_size( 'shaan_featured_image', 600, 250, true ); add_theme_support( 'custom-header', apply_filters( 'shaan_custom_header_args', array( 'default-image' => '', 'default-text-color' => 'fff', 'width' => 950, 'height' => 100, 'wp-head-callback' => 'shaan_header_style', 'admin-head-callback' => 'shaan_admin_header_style', ) ) ); add_theme_support( 'custom-background' ); register_nav_menus( array( 'primary-menu' => __( 'Header Navigation', 'shaan' ), 'footer-menu' => __( 'Footer Navigation', 'shaan' ), ) ); add_action( 'widgets_init', 'shaan_register_sidebar' ); add_filter( 'excerpt_length', 'shaan_excerpt_length' ); add_filter( 'excerpt_more', 'shaan_auto_excerpt_more' ); add_action( 'comment_form_before_fields', 'shaan_comment_form_before_fields' ); add_action( 'comment_form_after_fields', 'shaan_comment_form_after_fields' ); add_theme_support( 'print-style' ); } } add_action( 'after_setup_theme', 'shaan_setup' ); /** * Register Google fonts style. * * @since Shaan 1.1.8-wpcom */ function shaan_register_fonts() { wp_register_style( 'shaan_font_molengo', "https://fonts.googleapis.com/css?family=Molengo", array(), '20120821' ); } add_action( 'init', 'shaan_register_fonts' ); /** * Google Font. * * Hooks into the 'wp_enqueue_scripts' filter. * * @access private * @since Shaan 1.1.8-wpcom */ function shaan_enqueue_color_style() { _deprecated_function( __FUNCTION__, '1.2', 'shaan_scripts()' ); wp_enqueue_script( 'shaan_font_molengo' ); } /** * Enqueue Google fonts style to admin screen for custom header display * * @since Shaan 1.1.8-wpcom */ function shaan_admin_fonts( $hook_suffix ) { if ( 'appearance_page_custom-header' != $hook_suffix ) return; wp_enqueue_style( 'shaan_font_molengo' ); } add_action( 'admin_enqueue_scripts', 'shaan_admin_fonts' ); /** * Comment Reply Script. * * Hooks into the 'wp_enqueue_scripts' filter. * * @access private * @since Shaan 1.1.8-wpcom */ function shaan_comment_reply_script() { _deprecated_function( __FUNCTION__, '1.2', 'shaan_scripts()' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } /** * Enqueue scripts and styles */ function shaan_scripts() { wp_enqueue_style( 'shaan_font_molengo' ); wp_enqueue_style( 'shaan', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'shaan_scripts' ); if ( ! function_exists( 'shaan_header_style' ) ) { function shaan_header_style() { $image = get_header_image(); $text_color = get_header_textcolor(); $description = get_bloginfo( 'description' ); if ( empty( $image ) && ! empty( $description ) && $text_color == HEADER_TEXTCOLOR ) return; ?> __( 'Sidebar', 'shaan' ), 'id' => 'sidebar-1', 'description' => __( 'The sidebar widget area.', 'shaan' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } /** * Length of Post Excerpts. * * Hooks into the 'excerpt_length' filter. * * @param int $length Excerpt length. * @return int Modified excerpt length. * * @access private * @since Shaan 1.1.8-wpcom */ function shaan_excerpt_length( $length ) { return 55; } /** * Append Ellipsis to Auto Generated Excerpts. * * Hooks into the 'excerpt_more' filter. * * @param string $more content to appeand to auto-generated excerpts. * @return string A space followed by ellipsis. * * @access private * @since Shaan 1.1.8-wpcom */ function shaan_auto_excerpt_more( $more ) { return __( ' …', 'shann' ); } if ( ! function_exists( 'shaan_comment' ) ) : /** * Template for comments and pingbacks. */ function shaan_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    comment_approved ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    '; } /** * Close the custom div opened by shaan_comment_form_before_fields(). * * Hooks into the "comment_form_after_fields" action. * * @since Shaan 1.1.8-wpcom * @access private */ function shaan_comment_form_after_fields() { echo "\n" . ''; } /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Shaan 1.1.8 */ function shaan_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', 'shaan' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'shaan_wp_title', 10, 2 );