Version ) ); define( 'ABC_THEME_NAME', $abc_theme_data->Name ); if ( ! isset( $content_width ) ) { $content_width = 680; } add_action( 'after_setup_theme', 'abc_setup' ); if ( ! function_exists( 'abc_setup' ) ) { function abc_setup() { load_theme_textdomain( 'byline', ABC_THEME_TEMPLATE . '/languages' ); add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); add_theme_support( 'custom-header', array( 'header-text' => false, 'flex-height' => true, 'flex-width' => true, 'random-default' => true, 'width' => apply_filters( 'abc_header_image_width', 1500 ), 'height' => apply_filters( 'abc_header_image_height', 600 ), ) ); register_default_headers( array( 'header01' => array( 'url' => '%s/images/header01.jpg', 'thumbnail_url' => '%s/images/header01-thumbnail.jpg', 'description' => __( 'Default Header 1', 'byline' ) ), ) ); add_editor_style( array( 'css/admin/editor-style.css', '/css/font-awesome.css', abc_fonts_url() ) ); register_nav_menu( 'primary', __( 'Primary Menu', 'byline' ) ); add_filter( 'use_default_gallery_style', '__return_false' ); foreach ( glob( ABC_THEME_TEMPLATE . '/inc/*' ) as $filename ) { include $filename; } } } add_action( 'wp_enqueue_scripts', 'abc_enqueue' ); if ( ! function_exists( 'abc_enqueue' ) ) { function abc_enqueue() { wp_enqueue_script( 'jquery-mobile', ABC_THEME_URL .'/js/jquery.mobile.custom.js', array( 'jquery' ), '4.1.2', true ); wp_enqueue_script( 'theme', ABC_THEME_URL .'/js/theme.js', array( 'jquery', 'jquery-mobile' ), '', true ); wp_enqueue_style( 'theme-stylesheet', get_stylesheet_uri() ); wp_enqueue_style( 'abc-google-fonts', abc_fonts_url() ); wp_enqueue_style( 'font-awesome', ABC_THEME_URL .'/css/font-awesome.css', false, '4.4.0' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } } if ( ! function_exists( 'abc_fonts_url' ) ) { function abc_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* * Translators: If there are characters in your language that are not supported * by Roboto, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Roboto font: on or off', 'byline' ) ) { $fonts[] = 'Roboto:300,400italic,700italic,400,500,700'; } /* * Translators: To add an additional character subset specific to your language, * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'byline' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } } add_action( 'widgets_init', 'abc_widgets_init' ); if ( ! function_exists( 'abc_widgets_init' ) ) { function abc_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'byline' ), 'id' => 'sidebar', 'description' => __( 'This section appears below the sidebar menu area.', 'byline' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } } add_action( 'pre_get_posts', 'abc_pre_get_posts' ); if ( ! function_exists( 'abc_pre_get_posts' ) ) { function abc_pre_get_posts( $query ) { if ( ! $query->is_home() || ! $query->is_main_query() ) return; global $withcomments; $withcomments = true; $query->set( 'posts_per_page', '1' ); $query->set( 'ignore_sticky_posts', '1' ); } } add_action( 'post_class', 'abc_post_class' ); function abc_post_class( $classes ) { if ( is_singular() || is_home() || is_404() ) { $classes[] = 'big-header'; } return $classes; } add_filter( 'the_excerpt', 'abc_excerpt_read_more_link' ); if ( ! function_exists( 'abc_excerpt_read_more_link' ) ) { function abc_excerpt_read_more_link( $output ) { return $output . '' . wp_kses_post( get_theme_mod( 'read_more_text', 'Continue reading' ) ) . ' ' . get_the_title() . ''; } } add_filter( 'the_content_more_link', 'abc_remove_more_link_scroll' ); if ( ! function_exists( 'abc_remove_more_link_scroll' ) ) { function abc_remove_more_link_scroll( $link ) { return preg_replace( '|#more-[0-9]+|', '', $link ); } } function abc_pagination() { global $wp_query; // Don't print empty markup if there's only one page. if ( $wp_query->max_num_pages < 2 ) return; ?> '', 'echo' => 0, 'number' => 5, 'depth' => 1, ) ); echo ''; } add_filter( 'abc_custom_color_defaults', 'byline_custom_color_defaults' ); function byline_custom_color_defaults() { return array( 'background_color' => '#2E3739', 'page_background_color' => '#ffffff', 'site_title_color' => '#ffffff', 'site_description_color' => '#ffffff', 'headers_color' => '#282828', 'main_text_color' => '#282828', 'post_title_color' => '#282828', 'post_meta_color' => '#282828', 'link_color' => '#141414', 'link_hover_color' => '#000000', ); } add_filter( 'abc_fonts_manager_defaults', 'byline_fonts_manager_defaults' ); function byline_fonts_manager_defaults() { return array( 'site_title_font' => 'Roboto||"Roboto", sans-serif', 'site_title_font_size' => '32', 'site_description_font' => 'Roboto||"Roboto", sans-serif', 'site_description_font_size' => '16', 'main_text_font' => 'Roboto||"Roboto", sans-serif', 'main_text_font_size' => '16', 'headers_font' => 'Roboto||"Roboto", sans-serif', 'post_title_font' => 'Roboto||"Roboto", sans-serif', 'post_title_font_size' => '32', 'post_meta_font' => 'Georgia, Times, "Times New Roman", serif', 'post_meta_font_size' => '12', ); } add_filter( 'abc_fonts_manager_google_fonts_defaults', 'byline_fonts_manager_google_fonts_defaults' ); function byline_fonts_manager_google_fonts_defaults() { return array ( 'Roboto' => array( 'weight' => '300,400,400italic,500,700,700italic', 'css' => '"Roboto", sans-serif', ), ); } function abc_search_title() { global $wp_query; $num = $wp_query->found_posts; printf( __( '%1$s search results for "%2$s"', 'byline'), absint( $wp_query->found_posts ), esc_html( get_search_query() ) ); } function abc_word_count() { return sprintf( __( '%s words', 'byline' ), str_word_count( strip_tags( get_post_field( 'post_content', get_the_ID() ) ) ) ); }