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' ); add_image_size( 'botiga-extra-large', 1140, 9999 ); add_image_size( 'botiga-large', 920, 9999 ); add_image_size( 'botiga-medium', 380, 9999 ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'botiga' ), 'secondary' => esc_html__( 'Top bar menu', 'botiga' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'botiga_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); /** * Wide alignments * */ add_theme_support( 'align-wide' ); /** * Color palettes */ $selected_palette = get_theme_mod( 'color_palettes', 'palette1' ); $palettes = botiga_global_color_palettes(); $colors = array(); for ( $i = 0; $i < 8; $i++ ) { $colors[] = array( /* translators: %s: color palette */ 'name' => sprintf( esc_html__( 'Color %s', 'botiga' ), $i ), 'slug' => $selected_palette . '-color-' . $i, 'color' => $palettes[$selected_palette][$i], ); } add_theme_support( 'editor-color-palette', $colors ); /** * Editor font sizes */ add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'Small', 'botiga' ), 'shortName' => esc_html_x( 'S', 'Font size', 'botiga' ), 'size' => 14, 'slug' => 'small', ), array( 'name' => esc_html__( 'Normal', 'botiga' ), 'shortName' => esc_html_x( 'N', 'Font size', 'botiga' ), 'size' => 16, 'slug' => 'normal', ), array( 'name' => esc_html__( 'Large', 'botiga' ), 'shortName' => esc_html_x( 'L', 'Font size', 'botiga' ), 'size' => 18, 'slug' => 'large', ), array( 'name' => esc_html__( 'Larger', 'botiga' ), 'shortName' => esc_html_x( 'L', 'Font size', 'botiga' ), 'size' => 24, 'slug' => 'larger', ), array( 'name' => esc_html__( 'Extra large', 'botiga' ), 'shortName' => esc_html_x( 'XL', 'Font size', 'botiga' ), 'size' => 32, 'slug' => 'extra-large', ), array( 'name' => esc_html__( 'Huge', 'botiga' ), 'shortName' => esc_html_x( 'XXL', 'Font size', 'botiga' ), 'size' => 48, 'slug' => 'huge', ), array( 'name' => esc_html__( 'Gigantic', 'botiga' ), 'shortName' => esc_html_x( 'XXXL', 'Font size', 'botiga' ), 'size' => 64, 'slug' => 'gigantic', ), ) ); /** * Responsive embeds */ add_theme_support( 'responsive-embeds' ); } endif; add_action( 'after_setup_theme', 'botiga_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 botiga_content_width() { $GLOBALS['content_width'] = apply_filters( 'botiga_content_width', 1140 ); // phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedVariableFound } add_action( 'after_setup_theme', 'botiga_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function botiga_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'botiga' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'botiga' ), 'before_widget' => '', 'before_title' => '