tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); add_image_size( 'fortress-featured-image', 710, 9999 ); add_image_size( 'fortress-featured-content', 220, 165 ); add_image_size( 'fortress-post-grid', 333, 250 ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'menu-1' => esc_html__( 'Top', 'fortress' ), ) ); /** * Add support for core custom logo. */ add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 480, 'flex-width' => true, 'flex-height' => true, ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'fortress_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); } endif; add_action( 'after_setup_theme', 'fortress_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function fortress_content_width() { $GLOBALS['content_width'] = apply_filters( 'fortress_content_width', 640 ); } add_action( 'after_setup_theme', 'fortress_content_width', 0 ); /** * Return early if Custom Logos are not available. * * @todo Remove after WP 4.7 */ function fortress_the_custom_logo() { if ( ! function_exists( 'the_custom_logo' ) ) { return; } else { the_custom_logo(); } } /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function fortress_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'fortress' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Full-Width Footer', 'fortress' ), 'id' => 'sidebar-2', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'fortress' ), 'id' => 'sidebar-3', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'fortress' ), 'id' => 'sidebar-4', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'fortress' ), 'id' => 'sidebar-5', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'fortress' ), 'id' => 'sidebar-6', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'fortress_widgets_init' ); /** * Register Google Fonts. */ function fortress_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Source Sans Pro, translate this to 'off'. Do not translate * into your own language. */ $sourcesanspro = esc_html_x( 'on', 'Source Sans Pro font: on or off', 'fortress' ); if ( 'off' !== $sourcesanspro ) { $font_families = array(); $font_families[] = 'Source Sans Pro:400,400italic,600,600italic'; $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 $fonts_url; } /** * Enqueue scripts and styles. */ function fortress_scripts() { wp_enqueue_style( 'fortress-style', get_stylesheet_uri() ); wp_enqueue_style( 'fortress-fonts', fortress_fonts_url(), array(), null ); // Add Genericons font. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' ); wp_enqueue_script( 'fortress-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '20151215', true ); wp_enqueue_script( 'fortress-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '20151215', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'fortress_scripts' ); /** * Custom Excerpt Length */ function fortress_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'fortress_excerpt_length', 999 ); /** * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link. * @return string 'Continue reading' link prepended with an ellipsis. */ if ( ! function_exists( 'fortress_excerpt_more' ) ) : function fortress_excerpt_more( $more ) { $link = sprintf( '%2$s', esc_url( get_permalink( get_the_ID() ) ), /* translators: %s: Name of current post */ sprintf( esc_html__( 'Continue reading %s', 'fortress' ), '' . get_the_title( get_the_ID() ) . '' ) ); return ' … ' . $link; } add_filter( 'excerpt_more', 'fortress_excerpt_more' ); endif; /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php';