'ffffff' ) ); $args = array( 'default-text-color' => '#e7e7e7', 'default-image' => '', 'height' => 150, 'width' => 325, 'max-width' => 325, 'flex-height' => true, 'flex-width' => false, 'random-default' => false, 'wp-head-callback' => 'alhana_header_style', 'admin-head-callback' => 'alhana_admin_header_style', 'admin-preview-callback' => 'alhana_admin_header_image' ); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'alhana_setup' ); function alhana_header_style() { $text_color = get_header_textcolor(); $header_image = get_header_image(); if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) return; ?>

= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'alhana' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'alhana_wp_title', 10, 2 ); function alhana_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'alhana' ), 'id' => 'sidebar-1', 'description' => __( 'Appears on Front Page, which has its own widgets', 'alhana' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Inner Sidebar', 'alhana' ), 'id' => 'sidebar-2', 'description' => __( 'Appears on posts and pages except the Front Page', 'alhana' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'alhana_widgets_init' ); if ( ! function_exists( 'alhana_content_nav' ) ) : function alhana_content_nav( $html_id ) { global $wp_query; $html_id = esc_attr( $html_id ); if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    '.get_comment_author_link().''; ?>

    ', '' ); ?> __( 'Reply', 'alhana' ), 'before' => '', 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> '.get_comment_date( 'd.m.Y' )); ?>

    comment_approved ) : ?>

    is_home() && $query->is_main_query() ) { $query->set( 'cat', '1' ); } } add_action( 'pre_get_posts', 'custom_category_on_homepage' ); function get_alhana_archive($show_comment_count=0, $show_cat_slug='bez-rubriki', $year=0, $post_type='post', $limit=100){ global $month, $wpdb; $result = ''; if($year) $AND_year = " AND YEAR(post_date)='$year'"; if($limit) $LIMIT = " LIMIT $limit"; $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM " . $wpdb->posts . " WHERE post_type='$post_type' AND post_status='publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC"); if($arcresults){ foreach($arcresults as $arcresult) { $text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year); $result .= '

    '.$text.'

    '; $thismonth = zeroise($arcresult->month,2); $thisyear = $arcresult->year; $arcresults2 = $wpdb->get_results("SELECT ID, post_date, post_title, comment_status, guid, comment_count FROM " . $wpdb->posts . " WHERE post_date LIKE '$thisyear-$thismonth-%' AND post_status='publish' AND post_type='$post_type' AND post_password='' ORDER BY post_date DESC $LIMIT"); if ($arcresults2){ $result .= "
    \n"; } } } return $result; } #Уничтожение автотрекбэков function kama_disable_inner_ping( &$links ){ $site_url = home_url(); foreach ( $links as $key => $val ) if ( strpos( $val, $site_url ) !== false ) unset($links[$key]); } add_action( 'pre_ping', 'kama_disable_inner_ping' ); ?>