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', array( 'height' => 54, 'width' => 192, 'flex-height' => true, 'flex-width' => 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( array( 'primary' => esc_html__( 'Primary', 'cassions' ), 'social-menu' => esc_html__( 'Social Icon', 'cassions' ), ) ); /* * 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', ) ); /* * Add support for Gutenberg. * * @link https://wordpress.org/gutenberg/handbook/reference/theme-support/ */ add_theme_support( 'align-wide' ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'responsive-embeds' ); } endif; add_action( 'after_setup_theme', 'cassions_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 cassions_content_width() { $GLOBALS['content_width'] = apply_filters( 'cassions_content_width', 640 ); } add_action( 'after_setup_theme', 'cassions_content_width', 0 ); if ( ! function_exists( 'cassions_fonts_url' ) ) : /** * @return string Google fonts URL for the theme. */ function cassions_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* * Translators: If there are characters in your language that are not supported * by Noto Sans, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Droid Serif font: on or off', 'cassions' ) ) { $fonts[] = 'Droid Serif:400italic,600italic,700italic,400,600,700'; } /* * Translators: To add an additional character subset specific to your language, * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'cassions' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } endif; /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function cassions_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'cassions' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'cassions' ), 'before_widget' => '
', 'before_title' => '