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' => __( 'Primary menu', 'short' ), ) ); //Custom background support add_theme_support( 'custom-background' ); // Set up the woocommerce feature. add_theme_support( 'woocommerce'); //Custom logo add_theme_support( 'custom-logo', array( 'height' => 50, 'width' => 200, 'flex-height' => true, 'unlink-homepage-logo' => true, // Add Here! ) ); // custom header Support $args = array( 'default-image' => get_template_directory_uri() .'/images/page-title-bg.jpg', 'width' => '1600', 'height' => '600', 'flex-height' => false, 'flex-width' => false, 'header-text' => true, ); add_theme_support( 'custom-header', $args ); //Added selective refresh for widget add_theme_support( 'customize-selective-refresh-widgets' ); } endif; add_action( 'after_setup_theme', 'short_setup' ); function short_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } } add_filter('get_custom_logo','short_logo_class'); function short_logo_class($html) { $html = str_replace('custom-logo-link', 'navbar-brand', $html); return $html; } /** * 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 short_content_width() { $GLOBALS['content_width'] = apply_filters( 'short_content_width', 640 ); } add_action( 'after_setup_theme', 'short_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function short_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar widget area', 'short' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Woocommerce widget area', 'short' ), 'id' => 'woo-sidebar', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer widget left area', 'short' ), 'id' => 'footer_widget_area_left', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer widget central area', 'short' ), 'id' => 'footer_widget_area_center', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer widget right area', 'short' ), 'id' => 'footer_widget_area_right', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'short_widgets_init' ); /*-----------------------------------------------------------------------------------*/ /* customizer-controls /*-----------------------------------------------------------------------------------*/ /* Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /*-----------------------------------------------------------------------------------*/ /* customizer-controls /*-----------------------------------------------------------------------------------*/ function short_enqueue_customizer_controls_styles() { wp_register_style( 'short-customizer-controls', get_template_directory_uri() . '/css/customizer-controls.css', NULL, NULL, 'all' ); wp_enqueue_style( 'short-customizer-controls' ); } add_action( 'customize_controls_print_styles', 'short_enqueue_customizer_controls_styles' ); /* * Load customize pro */ require_once( trailingslashit( get_template_directory() ) . 'inc/mnt/customize-pro/class-customize.php' ); if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * * Added for backwards compatibility to support pre 5.2.0 WordPress versions. * * @since Twenty Nineteen 1.4 */ function wp_body_open() { /** * Triggered after the opening tag. * * @since Twenty Nineteen 1.4 */ do_action( 'wp_body_open' ); } endif; //enqueues our external font awesome stylesheet function enqueue_our_required_stylesheets(){ wp_enqueue_style('short-font-awesome',get_template_directory_uri().'/css/font-awesome.min.css'); } add_action('admin_enqueue_scripts','enqueue_our_required_stylesheets'); add_filter( 'woocommerce_show_page_title', 'short_hide_shop_page_title' ); function short_hide_shop_page_title( $title ) { if ( is_shop() ) $title = false; return $title; } ?>