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( 1568, 9999 ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'seedlet' ), 'footer' => __( 'Footer Navigation', 'seedlet' ), 'social' => __( 'Social Links Navigation', 'seedlet' ), ) ); /* * 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', 'style', 'script', 'navigation-widgets', ) ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 240, 'width' => 240, 'flex-width' => false, 'flex-height' => false, ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for editor styles. add_theme_support( 'editor-styles' ); $editor_stylesheet_path = './assets/css/style-editor.css'; // Enqueue editor styles. add_editor_style( array( seedlet_fonts_url(), './assets/css/style-editor.css', ) ); // Add custom editor font sizes. add_theme_support( 'editor-font-sizes', array( array( 'name' => __( 'Tiny', 'seedlet' ), 'shortName' => __( 'XS', 'seedlet' ), 'size' => 14, 'slug' => 'tiny', ), array( 'name' => __( 'Small', 'seedlet' ), 'shortName' => __( 'S', 'seedlet' ), 'size' => 16, 'slug' => 'small', ), array( 'name' => __( 'Normal', 'seedlet' ), 'shortName' => __( 'M', 'seedlet' ), 'size' => 18, 'slug' => 'normal', ), array( 'name' => __( 'Large', 'seedlet' ), 'shortName' => __( 'L', 'seedlet' ), 'size' => 24, 'slug' => 'large', ), array( 'name' => __( 'Huge', 'seedlet' ), 'shortName' => __( 'XL', 'seedlet' ), 'size' => 28, 'slug' => 'huge', ), ) ); // Editor color palette. $colors_theme_mod = get_theme_mod( 'custom_colors_active' ); $primary = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-primary' ) ) ) ? '#000000' : get_theme_mod( 'seedlet_--global--color-primary' ); $secondary = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-secondary' ) ) ) ? '#3C8067' : get_theme_mod( 'seedlet_--global--color-secondary' ); $foreground = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-foreground' ) ) ) ? '#333333' : get_theme_mod( 'seedlet_--global--color-foreground' ); $tertiary = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-tertiary' ) ) ) ? '#FAFBF6' : get_theme_mod( 'seedlet_--global--color-tertiary' ); $background = ( ! empty( $colors_theme_mod ) && 'default' === $colors_theme_mod || empty( get_theme_mod( 'seedlet_--global--color-background' ) ) ) ? '#FFFFFF' : get_theme_mod( 'seedlet_--global--color-background' ); add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'Primary', 'seedlet' ), 'slug' => 'primary', 'color' => $primary, ), array( 'name' => __( 'Secondary', 'seedlet' ), 'slug' => 'secondary', 'color' => $secondary, ), array( 'name' => __( 'Foreground', 'seedlet' ), 'slug' => 'foreground', 'color' => $foreground, ), array( 'name' => __( 'Tertiary', 'seedlet' ), 'slug' => 'tertiary', 'color' => $tertiary, ), array( 'name' => __( 'Background', 'seedlet' ), 'slug' => 'background', 'color' => $background, ), ) ); $gradient_color_a = $secondary; $gradient_color_b = $tertiary; add_theme_support( 'editor-gradient-presets', array( array( 'name' => __( 'Diagonal', 'seedlet' ), 'gradient' => 'linear-gradient(to bottom right, ' . $gradient_color_a . ' 49.9%, ' . $gradient_color_b . ' 50%)', 'slug' => 'hard-diagonal', ), array( 'name' => __( 'Diagonal inverted', 'seedlet' ), 'gradient' => 'linear-gradient(to top left, ' . $gradient_color_a . ' 49.9%, ' . $gradient_color_b . ' 50%)', 'slug' => 'hard-diagonal-inverted', ), array( 'name' => __( 'Horizontal', 'seedlet' ), 'gradient' => 'linear-gradient(to bottom, ' . $gradient_color_a . ' 50%, ' . $gradient_color_b . ' 50%)', 'slug' => 'hard-horizontal', ), array( 'name' => __( 'Horizontal inverted', 'seedlet' ), 'gradient' => 'linear-gradient(to top, ' . $gradient_color_a . ' 50%, ' . $gradient_color_b . ' 50%)', 'slug' => 'hard-horizontal-inverted', ), array( 'name' => __( 'Diagonal gradient', 'seedlet' ), 'gradient' => 'linear-gradient(to bottom right, ' . $gradient_color_a . ', ' . $gradient_color_b . ')', 'slug' => 'diagonal', ), array( 'name' => __( 'Diagonal inverted gradient', 'seedlet' ), 'gradient' => 'linear-gradient(to top left, ' . $gradient_color_a . ', ' . $gradient_color_b . ')', 'slug' => 'diagonal-inverted', ), array( 'name' => __( 'Horizontal gradient', 'seedlet' ), 'gradient' => 'linear-gradient(to bottom, ' . $gradient_color_a . ', ' . $gradient_color_b . ')', 'slug' => 'horizontal', ), array( 'name' => __( 'Horizontal inverted gradient', 'seedlet' ), 'gradient' => 'linear-gradient(to top, ' . $gradient_color_a . ', ' . $gradient_color_b . ')', 'slug' => 'horizontal-inverted', ), array( 'name' => __( 'Stripe', 'seedlet' ), 'gradient' => 'linear-gradient(to bottom, transparent 20%, ' . $gradient_color_a . ' 20%, ' . $gradient_color_a . ' 80%, transparent 80%)', 'slug' => 'stripe', ), ) ); // Add support for responsive embedded content. add_theme_support( 'responsive-embeds' ); // Add support for custom line height controls. add_theme_support( 'custom-line-height' ); // Add support for link color control. add_theme_support( 'link-color' ); // Add support for experimental cover block spacing. add_theme_support( 'custom-spacing' ); // Add support for custom units. add_theme_support( 'custom-units' ); // Add support for WordPress.com Global Styles. add_theme_support( 'jetpack-global-styles', array( 'enable_theme_default' => true, ) ); } endif; add_action( 'after_setup_theme', 'seedlet_setup' ); /** * Add Google webfonts, if necessary * * - See: http://themeshaper.com/2014/08/13/how-to-add-google-fonts-to-wordpress-themes/ */ function seedlet_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Fira Sans, translate this to 'off'. Do not translate * into your own language. */ $fira_sans = esc_html_x( 'on', 'Fira Sans: on or off', 'seedlet' ); /* Translators: If there are characters in your language that are not * supported by Playfair Display, translate this to 'off'. Do not translate * into your own language. */ $playfair_display = esc_html_x( 'on', 'Playfair Display: on or off', 'seedlet' ); if ( 'off' !== $fira_sans || 'off' !== $playfair_display ) { $font_families = array(); if ( 'off' !== $fira_sans ) { $font_families[] = 'Fira Sans:ital,wght@0,400;0,500;1,400'; } if ( 'off' !== $playfair_display ) { $font_families[] = 'Playfair Display:ital,wght@0,400;0,700;1,400'; } /** * 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 esc_url_raw( $fonts_url ); } /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function seedlet_widgets_init() { register_sidebar( array( 'name' => __( 'Footer', 'seedlet' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your footer.', 'seedlet' ), 'before_widget' => '
', 'before_title' => '