tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 1600, 900, true ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'arbutus' ), ) ); /* * 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', 'script', 'style', 'navigation-widgets' ) ); /* * Add support for instant widget live previews in the customizer. */ add_theme_support( 'customize-selective-refresh-widgets', true ); /* * Enable support for Post Formats. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image', 'quote', 'video', 'audio' ) ); /** * Setup the WordPress core custom header feature. */ add_theme_support( 'custom-header', apply_filters( 'arbutus_custom_header_args', array( 'default-image' => '', 'width' => 1600, 'height' => 900, 'header-text' => false, 'random-defailt' => true, 'video' => true, ) ) ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'beach-madrone' => array( 'url' => '%s/img/headers/beach-madrone.jpg', 'thumbnail_url' => '%s/img/headers/beach-madrone-small.jpg', /* translators: header image description */ 'description' => __( 'Beach Madrone', 'arbutus' ) ), 'marina-strawberry' => array( 'url' => '%s/img/headers/marina-strawberry.jpg', 'thumbnail_url' => '%s/img/headers/marina-strawberry-small.jpg', /* translators: header image description */ 'description' => __( 'Marina Strawberry', 'arbutus' ) ), 'madrone-berries' => array( 'url' => '%s/img/headers/madrone-berries.jpg', 'thumbnail_url' => '%s/img/headers/madrone-berries-small.jpg', /* translators: header image description */ 'description' => __( 'Madrone Berries', 'arbutus' ) ), ) ); /* * Add support for custom logos. */ add_theme_support( 'custom-logo', array( 'height' => 115, 'width' => 230, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), 'unlink-homepage-logo' => true, ) ); /** * Allow widgets to be previewed faster in the customizer with selective refresh. */ add_theme_support( 'customize-selective-refresh-widgets' ); // Disable user-defined font size selection to encourage consistency. add_theme_support( 'disable-custom-font-sizes' ); // Disable color pickers in the editor in favor of theme colors. add_theme_support( 'disable-custom-colors' ); // Disable gradients. add_theme_support( 'disable-custom-gradients' ); add_theme_support( 'editor-gradient-presets', array() ); // Add support for wide alignments in the block editor; add_theme_support( 'align-wide' ); // Load classic editor styles into the block editor. add_theme_support( 'editor-styles' ); /* * This theme styles the visual editor to resemble the theme style. */ add_editor_style( array( 'editor-style.css', arbutus_font_url() ) ); // Load default block styles. add_theme_support( 'wp-block-styles' ); // Add support for the theme color scheme. add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'Black', 'arbutus' ), 'slug' => 'black', 'color' => '#000000', ), array( 'name' => __( 'Charcoal', 'arbutus' ), 'slug' => 'charcoal', 'color' => '#222222', ), array( 'name' => __( 'Light Gray', 'arbutus' ), 'slug' => 'light-gray', 'color' => '#cccccc', ), array( 'name' => __( 'White', 'arbutus' ), 'slug' => 'white', 'color' => '#ffffff', ), array( 'name' => __( 'Accent Light', 'arbutus' ), 'slug' => 'accent-light', 'color' => get_theme_mod( 'accent_color', '#93a3d8' ), ), array( 'name' => __( 'Accent Dark', 'arbutus' ), 'slug' => 'accent-dark', 'color' => '#2c12ed', ), ) ); // Disable gradients. add_theme_support( 'disable-custom-gradients' ); add_theme_support( 'editor-gradient-presets', array() ); /* * Add theme support for starter content. */ add_theme_support( 'starter-content', array( 'posts' => array( 'about', 'contact', ), 'options' => array( 'show_on_front' => 'posts', ), 'nav_menus' => array( 'primary' => array( 'name' => __( 'Primary Menu', 'arbutus' ), 'items' => array( 'link_home', 'page_about', 'page_contact', ), ), ), 'widgets' => array( 'footer' => array( 'search', 'text_about', 'categories', ), ), ) ); } endif; // arbutus_setup add_action( 'after_setup_theme', 'arbutus_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 arbutus_content_width() { $content_width = $GLOBALS['content_width']; if ( ! is_singular() ) { $content_width = 660; } /** * Filter Arbutus content width of the theme. * * @since Arbutus 1.0 * * @param $content_width integer */ $GLOBALS['content_width'] = apply_filters( 'arbutus_content_width', $content_width ); } add_action( 'template_redirect', 'arbutus_content_width', 0 ); /** * Register widget area. * * @link http://codex.wordpress.org/Function_Reference/register_sidebar */ function arbutus_widgets_init() { register_sidebar( array( 'name' => __( 'Footer', 'arbutus' ), 'id' => 'footer', 'description' => '', 'before_widget' => '', 'before_title' => '