'fafafa', ) ); register_nav_menu( 'menu', __( 'Navigation Menu', 'article' ) ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(590, 9999); } add_action( 'after_setup_theme', 'article_setup' ); require( get_template_directory() . '/inc/custom-header.php' ); if ( ! function_exists( 'article_scripts_styles' ) ) : function article_scripts_styles() { if (is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'article-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true ); if ( 'off' !== _x( 'on', 'Source Sans Pro font: on or off', 'article' ) ) { $subsets = 'latin,latin-ext'; $subset = _x( 'no-subset', 'Source Sans Pro font: add new subset (greek, cyrillic, vietnamese)', 'article' ); if ( 'cyrillic' == $subset ) $subsets .= ',cyrillic,cyrillic-ext'; elseif ( 'greek' == $subset ) $subsets .= ',greek,greek-ext'; elseif ( 'vietnamese' == $subset ) $subsets .= ',vietnamese'; $protocol = is_ssl() ? 'https' : 'http'; $query_args = array( 'family' => 'Source+Sans+Pro:400italic,700italic,400,700', 'subset' => $subsets, ); wp_enqueue_style( 'article-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null ); } wp_enqueue_style( 'article-style', get_stylesheet_uri() ); } add_action( 'wp_enqueue_scripts', 'article_scripts_styles' ); endif; if ( ! function_exists( 'article_wp_title' ) ) : function article_wp_title( $title, $sep ) { global $paged, $page; if( is_feed() ) return $title; $title .= get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); if( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; if( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'article' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'article_wp_title', 10, 2 ); endif; if ( ! function_exists( 'article_page_menu_args' ) ) : function article_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'article_page_menu_args' ); endif; if ( ! function_exists( 'article_excerpt_length' ) ) : function article_excerpt_length( $length ) { return 35; } add_filter( 'excerpt_length', 'article_excerpt_length' ); endif; if ( ! function_exists( 'article_continue_reading_link' ) ) : function article_continue_reading_link() { global $post; return '

' . __('Continue to read...', 'article') . '

'; } endif; if ( ! function_exists( 'article_auto_excerpt_more' ) ) : function article_auto_excerpt_more( $more ) { return ' …' . article_continue_reading_link(); } add_filter( 'excerpt_more', 'article_auto_excerpt_more' ); endif; if ( ! function_exists( 'article_custom_excerpt_more' ) ) : function article_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= article_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'article_custom_excerpt_more' ); endif; if ( ! function_exists( 'article_widgets_init' ) ) : function article_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'article' ), 'id' => 'sidebar-1', 'description' => __( 'This widget will appears on posts and pages except on our optional Front page template.', 'article' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'First Front Page Widget Area', 'article' ), 'id' => 'sidebar-2', 'description' => __( 'This widget will appears when using the optional Front page template with a page set as Static Front page.', 'article' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Second Front Page Widget Area', 'article' ), 'id' => 'sidebar-3', 'description' => __( 'This widget will appears when using the optional Front Page template with a page set as Static Front Page.', 'article' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'article_widgets_init' ); endif; if ( ! function_exists( 'article_content_nav' ) ) : function article_content_nav($nav_id) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> comment_type) : case 'pingback' : case 'trackback' : ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %1$s %2$s', get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? ' ' . __( 'Post author', 'article' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), sprintf( __( '%1$s at %2$s', 'article' ), get_comment_date(), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    ', '

    ' ); ?>
    __( 'Reply ', 'article' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $author = sprintf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'article' ), get_the_author() ) ), get_the_author() ); if ($tag_list) { $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s by %4$s.', 'article' ); } elseif ($categories_list) { $utility_text = __( 'This entry was posted in %1$s on %3$s by %4$s.', 'article' ); } else { $utility_text = __( 'This entry was posted on %3$s by %4$s.', 'article' ); } printf( $utility_text, $categories_list, $tag_list, $date, $author ); } endif; function article_body_class($classes) { if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) $classes[] = 'full-width'; if (is_page_template( 'page-templates/front-page.php' ) ) { $classes[] = 'template-front-page'; if (has_post_thumbnail() ) $classes[] = 'has-post-thumbnail'; if (is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) $classes[] = 'two-sidebars'; } if (wp_style_is( 'article-fonts', 'queue' ) ) $classes[] = 'custom-font-enabled'; if ( ! is_multi_author() ) $classes[] = 'single-author'; return $classes; } add_filter( 'body_class', 'article_body_class' ); function article_content_width() { if (is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 960; } } add_action( 'template_redirect', 'article_content_width' ); function article_customize_register($wp_customize) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; } add_action( 'customize_register', 'article_customize_register' ); function article_customize_preview_js() { wp_enqueue_script( 'article-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', TRUE); } add_action( 'customize_preview_init', 'article_customize_preview_js' );