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. * * @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', 'blossom-fashion' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'blossom_fashion_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'header-text' => array( 'site-title', 'site-description' ) ) ); add_theme_support( 'custom-header', apply_filters( 'blossom_fashion_custom_header_args', array( 'default-image' => '', 'video' => true, 'width' => 1920, 'height' => 760, 'header-text' => false ) ) ); /** Images sizes */ add_image_size( 'blossom-fashion-slider', 1920, 760, true ); add_image_size( 'blossom-fashion-featured', 400, 230, true ); add_image_size( 'blossom-fashion-with-sidebar', 925, 540, true ); add_image_size( 'blossom-fashion-fullwidth', 1320, 540, true ); add_image_size( 'blossom-fashion-blog-home', 435, 332, true ); add_image_size( 'blossom-fashion-blog-archive', 260, 200, true ); add_image_size( 'blossom-fashion-related', 300, 232, true ); add_image_size( 'blossom-fashion-popular', 280, 215, true ); // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); } endif; add_action( 'after_setup_theme', 'blossom_fashion_setup' ); /** * Set up the WordPress core custom header feature. * * @uses blossom_fashion_header_style() */ function blossom_fashion_custom_header_setup() { } add_action( 'after_setup_theme', 'blossom_fashion_custom_header_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 blossom_fashion_content_width() { $GLOBALS['content_width'] = apply_filters( 'blossom_fashion_content_width', 925 ); } add_action( 'after_setup_theme', 'blossom_fashion_content_width', 0 ); if( ! function_exists( 'blossom_fashion_template_redirect_content_width' ) ) : /** * Adjust content_width value according to template. * * @return void */ function blossom_fashion_template_redirect_content_width(){ // Full Width in the absence of sidebar. if( is_singular() ){ $sidebar_layout = blossom_fashion_sidebar_layout(); if( ( $sidebar_layout == 'full-width' ) || ! is_active_sidebar( 'sidebar' ) ) $GLOBALS['content_width'] = 1320; }elseif( ! is_active_sidebar( 'sidebar' ) ){ $GLOBALS['content_width'] = 1320; } } endif; add_action( 'template_redirect', 'blossom_fashion_template_redirect_content_width' ); /** * Enqueue scripts and styles. */ function blossom_fashion_scripts() { // Use minified libraries if SCRIPT_DEBUG is false $build = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '/build' : ''; $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; $args = array( 'family' => 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Cormorant+Garamond:300,300i,400,400i,500,500i,600,600i,700,700i|Rufina:400,700|Lora', ); wp_enqueue_style( 'font-awesome', get_template_directory_uri(). '/css' . $build . '/font-awesome' . $suffix . '.css', array(), '4.7' ); wp_enqueue_style( 'owl-carousel', get_template_directory_uri(). '/css' . $build . '/owl.carousel' . $suffix . '.css', array(), '2.2.1' ); wp_enqueue_style( 'animate', get_template_directory_uri(). '/css' . $build . '/animate' . $suffix . '.css', array(), '3.5.2' ); wp_enqueue_style( 'blossom-fashion-google-fonts', add_query_arg( $args, "//fonts.googleapis.com/css" ), array(), null ); wp_enqueue_style( 'blossom-fashion-style', get_stylesheet_uri(), array(), BLOSSOM_FASHION_THEME_VERSION ); wp_enqueue_script( 'owl-carousel', get_template_directory_uri() . '/js' . $build . '/owl.carousel' . $suffix . '.js', array( 'jquery' ), '2.2.1', true ); wp_enqueue_script( 'blossom-fashion-custom', get_template_directory_uri() . '/js' . $build . '/custom' . $suffix . '.js', array( 'jquery' ), BLOSSOM_FASHION_THEME_VERSION, true ); $array = array( 'rtl' => is_rtl(), 'animation' => get_theme_mod( 'slider_animation' ), 'ajax_url' => admin_url( 'admin-ajax.php' ), ); wp_localize_script( 'blossom-fashion-custom', 'blossom_fashion_data', $array ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'blossom_fashion_scripts' ); /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function blossom_fashion_body_classes( $classes ) { // Adds a class of hfeed to non-singular pages. if ( ! is_singular() ) { $classes[] = 'hfeed'; } // Adds a class of custom-background-image to sites with a custom background image. if ( get_background_image() ) { $classes[] = 'custom-background-image custom-background'; } // Adds a class of custom-background-color to sites with a custom background color. if ( get_background_color() != 'ffffff' ) { $classes[] = 'custom-background-color custom-background'; } $classes[] = blossom_fashion_sidebar_layout(); /** * TO DO: REMOVE THIS CODE AFTER ANUP CHANGES THE CLASS IN PAGE */ if( is_page() ){ $classes[] = 'single'; } return $classes; } add_filter( 'body_class', 'blossom_fashion_body_classes' ); if( ! function_exists( 'blossom_fashion_post_classes' ) ) : /** * Add custom classes to the array of post classes. */ function blossom_fashion_post_classes( $classes ){ global $wp_query; if( is_front_page() && is_home() && $wp_query->current_post == 0 ){ $classes[] = 'first-post'; } return $classes; } endif; add_filter( 'post_class', 'blossom_fashion_post_classes' ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function blossom_fashion_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'blossom_fashion_pingback_header' ); if( ! function_exists( 'blossom_fashion_get_archive_title' ) ) : /** * Archive Title Filter */ function blossom_fashion_get_archive_title( $title ){ $ed_prefix = get_theme_mod( 'ed_prefix_archive', false ); if( is_category() ){ if( $ed_prefix ){ $title = '