/**
* consultstreet functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package consultstreet
*/
if ( ! function_exists( 'consultstreet_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function consultstreet_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on consultstreet, use a find and replace
* to change 'consultstreet' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'consultstreet', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
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.
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'consultstreet' ),
) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// woocommerce support
add_theme_support( 'woocommerce' );
// Woocommerce Gallery Support
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support( 'custom-logo', array(
'height' => 42,
'width' => 257,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
) );
/**
* Enable support for Post Formats.
*
* See: https://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'status',
'audio',
'chat',
) );
/**
* Custom background support.
*/
add_theme_support( 'custom-background', apply_filters( 'consultstreet_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/**
* Set default content width.
*/
if ( ! isset( $content_width ) ) {
$content_width = 800;
}
}
endif;
add_action( 'after_setup_theme', 'consultstreet_setup' );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function consultstreet_widgets_init() {
$sidebars = apply_filters( 'consultstreet_sidebars_data', array(
'sidebar-main' => esc_html__( 'Sidebar', 'consultstreet' ),
'footer-sidebar-one' => esc_html__( 'Footer Sidebar One', 'consultstreet' ),
'footer-sidebar-two' => esc_html__( 'Footer Sidebar Two', 'consultstreet' ),
'footer-sidebar-three' => esc_html__( 'Footer Sidebar Three', 'consultstreet' ),
'footer-sidebar-four' => esc_html__( 'Footer Sidebar Four', 'consultstreet' ),
) );
if ( class_exists( 'WooCommerce' ) ) {
$sidebars['woocommerce'] = esc_html__( 'WooCommerce Sidebar', 'consultstreet' );
}
foreach ( $sidebars as $id => $name ) :
register_sidebar( array(
'id' => $id,
'name' => $name,
'description' => esc_html__( 'Add widgets here.', 'consultstreet' ),
'before_widget' => '',
'before_title' => '