tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for custom logo. */ add_theme_support( 'custom-logo', apply_filters( 'shapla_custom_logo_args', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ) ); /* * 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' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( apply_filters( 'shapla_register_nav_menus', array( 'primary' => esc_html__( 'Primary', 'shapla' ), 'social-nav' => esc_html__( 'Social Link', 'shapla' ), ) ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', apply_filters( 'shapla_html5_args', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'shapla_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Set up the WordPress core custom header feature. add_theme_support( 'custom-header', apply_filters( 'shapla_custom_header_args', array( 'default-image' => '', 'header-text' => false, 'width' => 1920, 'height' => 500, 'flex-width' => true, 'flex-height' => true, ) ) ); // Indicate widget sidebars can use selective refresh in the Customizer. add_theme_support( 'customize-selective-refresh-widgets' ); // Load default block styles. // add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for responsive embedded content add_theme_support( 'responsive-embeds' ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ $editor_style = get_template_directory_uri() . '/assets/css/editor-style.css'; add_editor_style( $editor_style ); // Load regular editor styles into the new block-based editor. add_theme_support( 'editor-styles' ); } /** * 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 * * @since 0.1.0 */ public function content_width() { $GLOBALS['content_width'] = apply_filters( 'shapla_content_width', 1140 ); } /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar * * @since 0.1.0 */ public function widgets_init() { $sidebar_args['sidebar'] = array( 'name' => __( 'Sidebar', 'shapla' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Widgets added to this region will appear beside the main content. Only show left or right sidebar layout.', 'shapla' ) ); $rows = intval( get_theme_mod( 'footer_widget_rows', 1 ) ); $regions = intval( get_theme_mod( 'footer_widget_columns', 4 ) ); for ( $row = 1; $row <= $rows; $row ++ ) { for ( $region = 1; $region <= $regions; $region ++ ) { $footer_n = $region + $regions * ( $row - 1 ); // Defines footer sidebar ID. $footer = sprintf( 'footer_%d', $footer_n ); if ( 1 == $rows ) { $footer_region_name = sprintf( __( 'Footer Column %1$d', 'shapla' ), $region ); $footer_region_description = sprintf( __( 'Widgets added here will appear in column %1$d of the footer.', 'shapla' ), $region ); } else { $footer_region_name = sprintf( __( 'Footer Row %1$d - Column %2$d', 'shapla' ), $row, $region ); $footer_region_description = sprintf( __( 'Widgets added here will appear in column %1$d of footer row %2$d.', 'shapla' ), $region, $row ); } $sidebar_args[ $footer ] = array( 'name' => $footer_region_name, 'id' => sprintf( 'footer-%d', $footer_n ), 'description' => $footer_region_description, ); } } foreach ( $sidebar_args as $sidebar => $args ) { $widget_tags = array( 'before_widget' => '
', 'before_title' => '