'Primary Menu', ) ); // Localization support load_theme_textdomain('blacklite', get_template_directory() . '/lang'); add_theme_support( "title-tag" ); add_theme_support('automatic-feed-links'); // Featured image add_theme_support( 'post-thumbnails' ); add_image_size( 'full-thumb', 1080, 0, true ); add_image_size( 'slider-thumb', 1080, 530, true ); add_image_size( 'misc-thumb', 520, 400, true ); } } // Load Google fonts function blacklite_google_fonts_url() { $fonts_url = ''; $Lato = _x( 'on', 'Lato font: on or off', 'blacklite' ); $Montserrat = _x( 'on', 'Montserrat font: on or off', 'blacklite' ); if ( 'off' !== $Montserrat || 'off' !== $Lato ) { $font_families = array(); if ('off' !== $Montserrat) { $font_families[] = 'Montserrat:400,700'; } if ('off' !== $Lato) { $font_families[] = 'Lato'; } $query_args = array( 'family' => urlencode(implode('|', $font_families )), 'subset' => urlencode('latin,latin-ext') ); $fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css'); } return esc_url_raw($fonts_url); } // Google fonts function blacklite_enqueue_googlefonts() { wp_enqueue_style( 'blacklite-googlefonts', blacklite_google_fonts_url(), array(), null ); } add_action('wp_enqueue_scripts', 'blacklite_enqueue_googlefonts'); // Register & enqueue styles/scripts add_action( 'wp_enqueue_scripts','blacklite_load_scripts' ); function blacklite_load_scripts() { // Register scripts and styles wp_enqueue_style('blacklite-style', get_template_directory_uri() . '/style.css'); wp_enqueue_style('fontawesome-css', get_template_directory_uri() . '/css/font-awesome.min.css'); wp_enqueue_script('jquery'); wp_enqueue_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', 'jquery', '', true); wp_enqueue_script('blacklite-scripts', get_template_directory_uri() . '/js/blacklite.js', 'jquery', '', true); if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); } // Include files // ===== Theme Options ===== require get_template_directory() . '/inc/customizer/zt_custom_controller.php'; require get_template_directory() . '/inc/customizer/zt_customizer_settings.php'; require get_template_directory() . '/inc/customizer/zt_customizer_style.php'; // Widgets require get_template_directory() . '/inc/widgets/about_widget.php'; require get_template_directory() . '/inc/widgets/post_widget.php'; require get_template_directory() . '/inc/widgets/social_widget.php'; // Register widgets if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name' => 'Sidebar', 'id' => 'sidebar-1', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Instagram Footer', 'id' => 'sidebar-2', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', 'description' => 'Use the "Instagram" widget here. IMPORTANT: For best result set number of photos to 8.', )); } // COMMENTS LAYOUT function blacklite_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="comment-">
    __('Reply', 'blacklite'), 'depth' => $depth, 'max_depth' => $args['max_depth'])), $comment->comment_ID); ?>
    comment_approved == '0') : ?>
  • = 2 || $page >= 2 ) && ! is_404() ) { $title = "$title $sep " . sprintf( __( 'Page %s', 'blacklite' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', 'blacklite_wp_title', 10, 2 ); // TWITTER AMPERSAND ENTITY DECODE function blacklite_social_title( $title ) { $title = html_entity_decode( $title ); $title = urlencode( $title ); return $title; } // THE EXCERPT function custom_excerpt_length( $length ) { return 200; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); function zt_string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) { array_pop($words); } return implode(' ', $words); }