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' => '
', '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-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), '1.7.10', true ); 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' ); /* Font-Awesome */ wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/fontawesome.all.min.css', null, '5.15.3'); 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' ) ) : function faith_enqueue_fonts() { wp_enqueue_style( 'faith-fonts', '//fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap', array(), '1.0' ); } endif; add_action( 'wp_enqueue_scripts', 'faith_enqueue_fonts' ); 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 ) : ?>
  • >
    ', '' ); ?>
  • >
    %s', get_comment_author_link() ); ?> comment_approved ) : ?>

    ', '' ); ?> 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '', 'after' => '', ) ) ); ?>
    %2$s', esc_url( home_url( '/' ) ), wp_get_attachment_image( $custom_logo_id, 'full', false, array( 'class' => 'custom-logo', 'alt' => __('Logo for ','faith') . esc_attr($site), ) ) ); } echo $html; } } endif; if ( ! function_exists( 'wp_body_open' ) ) { function wp_body_open() { do_action( 'wp_body_open' ); } } /** * Adds custom classes to the array of body classes. * * @since Faith 1.0.8 * * @param array $classes Classes for the body element. * @return array (Maybe) filtered body classes. */ function faith_body_classes( $classes ) { if ( ilovewp_helper_get_page_layout() != '' ) { $classes[] = ilovewp_helper_get_page_layout(); } $classes[] = ilovewp_helper_get_header_style(); $classes[] = ilovewp_helper_get_slideshow_status(); return $classes; } add_filter( 'body_class', 'faith_body_classes' ); /** * Implement the Custom Header feature. */ require get_parent_theme_file_path( '/inc/custom-header.php' ); /** * Customizer additions. */ require get_parent_theme_file_path() . '/inc/customizer.php'; /* Include Additional Options and Components ================================== */ require_once( get_template_directory() . '/ilovewp-admin/helper-functions.php'); require_once( get_template_directory() . '/ilovewp-admin/components/ilovewp-tgmpa.php'); //require only in admin! if(is_admin()){ require_once('ilovewp-admin/ilovewp-theme-settings.php'); if (current_user_can( 'manage_options' ) ) { require_once(get_template_directory() . '/ilovewp-admin/admin-notices/ilovewp-notices.php'); require_once(get_template_directory() . '/ilovewp-admin/admin-notices/ilovewp-notice-welcome.php'); require_once(get_template_directory() . '/ilovewp-admin/admin-notices/ilovewp-notice-review.php'); // Remove theme data from database when theme is deactivated. add_action('switch_theme', 'faith_db_data_remove'); if ( ! function_exists( 'faith_db_data_remove' ) ) { function faith_db_data_remove() { delete_option( 'faith_admin_notices'); delete_option( 'faith_theme_installed_time'); } } } } if ( ! function_exists( 'faith_bbp_supported_patterns' ) ) : function faith_bbp_supported_patterns($hook) { $pattern_slugs = array( 'bbp-pattern-general-about-1', 'bbp-pattern-general-call-to-action-2', 'bbp-pattern-general-call-to-action-3', 'bbp-pattern-general-contact-2', 'bbp-pattern-general-featured-pages-1', 'bbp-pattern-general-featured-pages-2', 'bbp-pattern-general-partners-1', 'bbp-pattern-general-partners-2', 'bbp-pattern-general-team-2', 'bbp-pattern-general-team-3' ); return $pattern_slugs; } endif; add_action( 'bbp_theme_supported_patterns', 'faith_bbp_supported_patterns' );