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' );
set_post_thumbnail_size( 200, 160, true );
// Featured Post Main Thumbnail on the front page & single page template
add_image_size( 'faith-large-thumbnail', 1600, 500, true );
add_image_size( 'faith-normal-thumbnail', 480, 300, true );
add_theme_support( 'responsive-embeds' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'faith' ),
'mobile' => esc_html__( 'Mobile Menu', 'faith' )
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'gallery',
'caption',
) );
add_theme_support( 'custom-logo', array(
'height' => 100,
'width' => 400,
'flex-width' => true,
'flex-height' => true,
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_action( 'customize_controls_print_styles', 'faith_customizer_stylesheet' );
}
endif; // faith_setup
add_action( 'after_setup_theme', 'faith_setup' );
if ( ! function_exists( 'faith_custom_sizes' ) ) :
add_filter( 'image_size_names_choose', 'faith_custom_sizes' );
function faith_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'faith-large-thumbnail' => __( 'Featured Image: Large (1600x500)', 'faith' ),
'faith-normal-thumbnail' => __( 'Featured Image: Normal (480x300)', 'faith' ),
'post-thumbnail' => __( 'Featured Image: Thumbnail (240x150)', 'faith' ),
) );
}
endif;
/* Custom Excerpt Length
==================================== */
if ( ! function_exists( 'faith_new_excerpt_length' ) ) :
add_filter( 'excerpt_length', 'faith_new_excerpt_length' );
function faith_new_excerpt_length( $length ) {
return is_admin() ? $length : 30;
}
endif;
if ( ! function_exists( 'faith_widgets_init' ) ) :
function faith_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Main Sidebar', 'faith' ),
'id' => 'sidebar-main',
'description' => esc_html__( 'This is the main sidebar area that appears on all pages.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Homepage: Left Column', 'faith' ),
'id' => 'home-col-1',
'description' => esc_html__( 'Works best with a standard Text Widget. The widget title will be wrapped in a tag.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Homepage: Right Column', 'faith' ),
'id' => 'home-col-2',
'description' => esc_html__( 'Works best with a widget like Recent Posts.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Site Header', 'faith' ),
'id' => 'site-header',
'description' => esc_html__( 'Works best with a search widget.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer: Column 1', 'faith' ),
'id' => 'sidebar-footer-1',
'description' => esc_html__( 'This is displayed in the footer of the website. By default has a width of 275px.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer: Column 2', 'faith' ),
'id' => 'sidebar-footer-2',
'description' => esc_html__( 'This is displayed in the footer of the website. By default has a width of 275px.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer: Column 3', 'faith' ),
'id' => 'sidebar-footer-3',
'description' => esc_html__( 'This is displayed in the footer of the website. By default has a width of 275px.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer: Column 4', 'faith' ),
'id' => 'sidebar-footer-4',
'description' => esc_html__( 'This is displayed in the footer of the website. By default has a width of 275px.', 'faith' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer: Column 5', 'faith' ),
'id' => 'sidebar-footer-5',
'description' => esc_html__( 'This is displayed in the footer of the website. By default has a width of 275px.', 'faith' ),
'before_widget' => '