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. */ add_theme_support( 'post-thumbnails' ); /* * Extra image sizes. */ set_post_thumbnail_size( 774, 400, true ); add_image_size( 'thumb774x400', 774, 400, true ); add_image_size( 'thumb288x154', 288, 154, true ); /* * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'global_nav' => esc_html__( 'Global Menu', 'amethyst' ), ) ); /* * 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', ) ); /* * Enable support for Post Formats. */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) ); /* * Set up the WordPress core custom background feature. */ add_theme_support( 'custom-background', apply_filters( 'amethyst_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); /* * Enable support editor-style on WordPress dashboard. */ add_editor_style( array( 'assets/css/editor-style.css', 'assets/genericons/genericons.css' ) ); } endif; // amethyst_setup add_action( 'after_setup_theme', 'amethyst_setup' ); /* * Extend the default WordPress body classes. * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ function amethyst_body_classes( $classes ) { if ( ( ! is_active_sidebar( 'sidebar' ) ) || is_attachment() ) { $classes[] = 'no-sidebar'; } return $classes; } add_filter( 'body_class', 'amethyst_body_classes' ); /* * 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 amethyst_content_width() { $GLOBALS['content_width'] = apply_filters( 'amethyst_content_width', 774 ); } add_action( 'after_setup_theme', 'amethyst_content_width', 0 ); /* * Register search form. */ function amethyst_search_form( $form ) { $form = '
'; return $form; } add_filter( 'get_search_form', 'amethyst_search_form' ); /* * Register excerpt length. */ function custom_excerpt_length( $length ) { return 30; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); /* * Register widget area. */ function amethyst_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'amethyst' ), 'id' => 'sidebar', 'description' => 'Main Widgets Sidebar. Shows up in all pages.', 'before_widget' => '', 'before_title' => '