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' ); // Post thumbnails add_image_size( 'dara-featured-image', 880, 312, true ); // Hero Image on the front page slider add_image_size( 'dara-hero-thumbnail', 1180, 600, true ); // Full width and grid page template add_image_size( 'dara-page-thumbnail', 1180, 435, true ); // Grid child page thumbnail add_image_size( 'dara-grid-thumbnail', 360, 242, true ); // Testimonial thumbnail add_image_size( 'dara-testimonial-thumbnail', 180, 180, true ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); // Add custom colors to Gutenberg add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Black', 'dara' ), 'slug' => 'black', 'color' => '#404040', ), array( 'name' => esc_html__( 'Dark Gray', 'dara' ), 'slug' => 'dark-gray', 'color' => '#444340', ), array( 'name' => esc_html__( 'Medium Gray', 'dara' ), 'slug' => 'medium-gray', 'color' => '#a8a6a1', ), array( 'name' => esc_html__( 'Light Gray', 'dara' ), 'slug' => 'light-gray', 'color' => '#e6e6e6', ), array( 'name' => esc_html__( 'White', 'dara' ), 'slug' => 'white', 'color' => '#ffffff', ), array( 'name' => esc_html__( 'Blue', 'dara' ), 'slug' => 'blue', 'color' => '#15b6b8', ), array( 'name' => esc_html__( 'Dark Blue', 'dara' ), 'slug' => 'dark-blue', 'color' => '#0c8384', ), ) ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'menu-1' => esc_html__( 'Header', 'dara' ), ) ); /* * 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', ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'dara_custom_background_args', array( 'default-color' => '444340', ) ) ); // Add theme support for custom logos add_theme_support( 'custom-logo', array( 'width' => 1200, 'height' => 300, 'flex-width' => true, 'flex-height' => true, ) ); // Add theme support for excerpts on pages add_post_type_support( 'page', 'excerpt' ); } endif; add_action( 'after_setup_theme', 'dara_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 dara_content_width() { $GLOBALS['content_width'] = apply_filters( 'dara_content_width', 825 ); } add_action( 'after_setup_theme', 'dara_content_width', 0 ); /** * Set larger content width in some situations. */ function dara_adjust_content_width() { /* Set the content width for the front-page or testimonials templates */ if ( is_post_type_archive( 'jetpack-testimonial' ) || ( is_front_page() ) ) { $GLOBALS['content_width'] = 1180; } /* Allow for full-width gallery display in the footer */ if ( is_active_sidebar( 'sidebar-2' ) || is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) ) { $GLOBALS['content_width'] = 1086; } } add_action( 'template_redirect', 'dara_adjust_content_width' ); /** * Return early if Custom Logos are not available. * * @todo Remove after WP 4.7 */ function dara_the_custom_logo() { if ( ! function_exists( 'the_custom_logo' ) ) { return; } else { the_custom_logo(); } } /** * Returns the Google font stylesheet URL, if available. */ function dara_fonts_url() { $merriweather = null; // This is most likely missing functionality; adding null init to pass rector. $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. */ $source_sans_pro = esc_html_x( 'on', 'Source Sans Pro font: on or off', 'dara' ); /* translators: If there are characters in your language that are not supported * by Yrsa, translate this to 'off'. Do not translate into your own language. */ $yrsa = esc_html_x( 'on', 'Yrsa font: on or off', 'dara' ); if ( 'off' !== $source_sans_pro || 'off' !== $merriweather || 'off' !== $yrsa ) { $font_families = array(); if ( 'off' !== $source_sans_pro ) { $font_families[] = 'Source Sans Pro:300,300italic,400,400italic,600'; } if ( 'off' !== $yrsa ) { $font_families[] = 'Yrsa:300,400,700'; } /** * A filter to enable child themes to add/change/omit font families. * * @param array $font_families An array of font families to be imploded for the Google Font API */ $font_families = apply_filters( 'included_google_font_families', $font_families ); $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; } /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function dara_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'dara' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '