tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /** * Add post-formats support. */ add_theme_support( 'post-formats', [ 'link', 'aside', 'gallery', 'image', 'quote', 'status', 'video', 'audio', 'chat', ] ); /** * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); add_image_size( 'themeoo-blog-grid', 540, 420, true ); add_image_size( 'themeoo-gallery', 420, 420, true ); add_image_size( 'themeoo-vertical', 300, 580, true ); $blog_normal = themeoo_get_mod( 'layout_blog_normal_image' ); $blog_medium = themeoo_get_mod( 'layout_blog_medium_image' ); $blog_grid = themeoo_get_mod( 'layout_blog_grid_image' ); if ( $blog_normal ) { $blog_normal = explode( ',', $blog_normal ); $blog_normal = array_map( 'absint', $blog_normal ); add_image_size( 'blog-normal', $blog_normal[0], $blog_normal[1], true ); } if ( $blog_medium ) { $blog_medium = explode( ',', $blog_medium ); $blog_medium = array_map( 'absint', $blog_medium ); add_image_size( 'blog-medium', $blog_medium[0], $blog_medium[1], true ); } if ( $blog_grid ) { $blog_grid = explode( ',', $blog_grid ); $blog_grid = array_map( 'absint', $blog_grid ); add_image_size( 'blog-grid', $blog_grid[0], $blog_grid[1], true ); } // This theme uses wp_nav_menu() in one location. register_nav_menus( [ 'primary' => __( 'Primary Menu', 'ayyash' ), 'mobile' => __( 'Mobile Menu ( Select when mobile menu is different )', 'ayyash' ), ] ); /** * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', [ 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', 'navigation-widgets', ] ); // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); // Add support for editor styles. add_theme_support( 'editor-styles' ); // Enqueue editor styles. add_editor_style( './assets/dist/css/style-editor.css' ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'themeoo_custom_background_args', [ 'default-color' => 'ffffff', 'default-image' => '', ] ) ); add_theme_support( 'custom-logo', [ 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, 'header-text' => [ 'site-title', 'site-description' ], 'unlink-homepage-logo' => true, ] ); // Set up the WordPress core custom header feature. add_theme_support( 'custom-header', [ 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ] ); // Add starter content if ( is_customize_preview() ) { /** * @see WP_Customize_Manager::setup_theme() * \--@see WP_Customize_Manager::import_theme_starter_content() * \--\--@see get_theme_starter_content() * @uses site-option:fresh_site */ require THEMEOO_THEME_DIR . 'inc/starter-content.php'; add_theme_support( 'starter-content', themeoo_get_starter_content() ); } // Add support for responsive embedded content. add_theme_support( 'responsive-embeds' ); // Add support for custom line height controls. add_theme_support( 'custom-line-height' ); // Add support for experimental link color control. add_theme_support( 'experimental-link-color' ); // Add support for experimental cover block spacing. add_theme_support( 'custom-spacing' ); } } if ( ! function_exists( 'wp_body_open' ) ) { /** * Fire the wp_body_open action. * Back compact. for 5.0.0 * * @return void */ function wp_body_open() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound,WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedFunctionFound do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound,WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedHooknameFound } } add_action( 'after_setup_theme', 'themeoo_setup' ); if ( ! function_exists( 'themeoo_extensions_flying_cart' ) ) { /** * /** * Enable Flying cart from theme. * * @return bool */ function themeoo_extensions_flying_cart() { return (bool) themeoo_get_mod( 'woocommerce_general_enable_product_flying_cart' ); } } add_filter( 'themeoo_extensions_flying_cart', 'themeoo_extensions_flying_cart' ); if ( ! function_exists( 'themeoo_enqueue_comments_reply' ) ) { /** * Enqueue Comments Reply into footer (comment-reply.js) * * @return void */ function themeoo_enqueue_comments_reply() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply', 'wp-includes/js/comment-reply', [], '1.0.0', true ); } } } add_action( 'comment_form_before', 'themeoo_enqueue_comments_reply' ); /** * ---------------------------------------------------------------------- * Advice for theme developer read carefully * If you are developing theme using ayyash Starter theme make sure * Not to write any new theme function * (The theme you are going to release using our starter framework) * Anywhere , Just use inc/themeoo-theme-extras.php which we created * for developer who is using ayyash for theme development . By maintaining * this advice , you can able to update base framework easily. Because we will not * write anything in the file. * ---------------------------------------------------------------------- */ // End of file functions.php.