'', 'default-text-color' => '000000', 'width' => 1300, 'height' => 500, 'flex-width' => true, 'flex-height' => true, ) ); // Add support for core custom logo. add_theme_support( 'custom-logo', array( 'width' => 450, 'height' => 200, 'flex-width' => true, 'flex-height' => false, ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', array( 'default-color' => '', 'default-image' => '', ) ); // Theme uses wp_nav_menu() at two locations register_nav_menus( array( 'main' => esc_html__( 'Main Menu', 'graceful' ), ) ); // Switch default core markup for search form, comment form, and comments to output valid HTML5 add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'gallery', 'caption', ) ); // Theme Activation Notice global $pagenow; if ( is_admin() && ('themes.php' == $pagenow) && isset( $_GET['activated'] ) ) { add_action( 'admin_notices', 'graceful_activation_notice' ); } // Enables support for post-thumbnails on post and pages add_theme_support( 'post-thumbnails' ); // Add Image Sizes graceful_add_image_sizes(); // Disable block editor in widgets WP 5.8+ remove_theme_support( 'widgets-block-editor' ); // Add support for Editor Styles. add_theme_support( 'editor-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for responsive embeds. add_theme_support( 'responsive-embeds' ); // Add support for default Gutenberg block styles add_theme_support( 'wp-block-styles' ); // WooCommerce theme support add_theme_support( 'woocommerce' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } add_action( 'after_setup_theme', 'graceful_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. * */ function graceful_content_width() { $GLOBALS['content_width'] = apply_filters( 'graceful_content_width', 960 ); } add_action( 'after_setup_theme', 'graceful_content_width', 0 ); /** ** Define theme specific image sizes. */ function graceful_add_image_sizes() { add_image_size( 'graceful-slider-full-thumbnail', 1024, 768, true ); add_image_size( 'graceful-full-thumbnail', 1140, 0, true ); add_image_size( 'graceful-column-thumbnail', 500, 330, true ); add_image_size( 'graceful-small-thumbnail', 75, 75, true ); } /** ** Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function graceful_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'graceful_pingback_header' ); /* ** Enqueue scripts and styles */ function graceful_scripts() { // Theme Stylesheet wp_enqueue_style( 'graceful-style', get_stylesheet_uri(), array(), _S_VERSION ); // Theme Dynamic Inline Styles wp_add_inline_style( 'graceful-style', graceful_inline_dynamic_styles() ); // RTL Stylesheet wp_style_add_data( 'graceful-style', 'rtl', 'replace' ); // FontAwesome Icons wp_enqueue_style( 'graceful-fontawesome', get_theme_file_uri( '/assets/css/font-awesome.css' ) ); // Google Fonts wp_enqueue_style( 'graceful-google-fonts', get_theme_file_uri( '/assets/css/google-fonts.css' ) ); // WooCommerce wp_enqueue_style( 'graceful-woocommerce', get_theme_file_uri( '/assets/css/woocommerce.css' ) ); // Enqueue Script wp_enqueue_script( 'graceful-main', get_theme_file_uri( '/assets/js/main.js' ), array( 'jquery' ), _S_VERSION, true ); } add_action( 'wp_enqueue_scripts', 'graceful_scripts' ); /* ** Register widgets. */ function graceful_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar Right', 'graceful' ), 'id' => 'sidebar-right', 'description' => __( 'Add widgets here, for right sidebar.', 'graceful' ), 'before_widget' => '', 'before_title' => '