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-medium-thumbnail' => __( 'Featured Image: Medium (800x250)', 'faith' ),
'faith-normal-thumbnail' => __( 'Featured Image: Normal (480x300)', 'faith' ),
'post-thumbnail' => __( 'Featured Image: Thumbnail (240x150)', 'faith' ),
) );
}
endif;
if ( ! function_exists( 'faith_theme_support_classic_widgets' ) ) :
function faith_theme_support_classic_widgets() {
remove_theme_support( 'widgets-block-editor' );
}
endif;
add_action( 'after_setup_theme', 'faith_theme_support_classic_widgets' );
/* 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' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'faith_widgets_init' );
endif;
/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function faith_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '' . "\n", esc_url(get_bloginfo( 'pingback_url' )) );
}
}
add_action( 'wp_head', 'faith_pingback_header' );
if ( ! function_exists( 'faith_theme_support_classic_widgets' ) ) :
function faith_theme_support_classic_widgets() {
remove_theme_support( 'widgets-block-editor' );
}
endif;
add_action( 'after_setup_theme', 'faith_theme_support_classic_widgets' );
/**
* --------------------------------------------
* Enqueue scripts and styles for the backend.
*
* @package Faith
* --------------------------------------------
*/
if ( ! function_exists( 'faith_scripts_admin' ) ) {
/**
* Enqueue admin styles and scripts
*
* @since 1.0.0
* @return void
*/
function faith_scripts_admin( $hook ) {
// if ( 'widgets.php' !== $hook ) return;
// Styles
wp_enqueue_style(
'faith-style-admin',
get_template_directory_uri() . '/ilovewp-admin/css/ilovewp_theme_settings.css',
'', ILOVEWP_VERSION, 'all'
);
}
}
add_action( 'admin_enqueue_scripts', 'faith_scripts_admin' );
/**
* Enqueue scripts and styles.
*/
function faith_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_style( 'faith-style', get_stylesheet_uri(), array(), $theme_version );
wp_enqueue_script(
'jquery-superfish',
get_template_directory_uri() . '/js/superfish.min.js',
array('jquery'),
true
);
wp_enqueue_script(
'jquery-flexslider',
get_template_directory_uri() . '/js/jquery.flexslider-min.js',
array('jquery'),
true
);
wp_register_script( 'faith-scripts', get_template_directory_uri() . '/js/faith.js', array( 'jquery' ), $theme_version, true );
wp_enqueue_script( 'faith-scripts' );
/* Icomoon */
wp_enqueue_style('ilovewp-icomoon', get_template_directory_uri() . '/css/icomoon.css', null, $theme_version);
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'faith_scripts' );
if ( ! function_exists( 'faith_comment' ) ) :
/**
* Template for comments and pingbacks.
* Used as a callback by wp_list_comments() for displaying the comments.
*/
function faith_comment( $comment, $args, $depth ) {
if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>