__( 'Primary Menu', 'businessdex' ), 'actions' => __( 'Actions Menu', 'businessdex' ), 'footer' => __( 'Footer Menu', 'businessdex' ) ) ); // 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', ) ); // Custom logo add_theme_support( 'custom-logo', apply_filters( 'businessdex_custom_logo___options', array( 'height' => 100, 'width' => 200, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title' ), ) ) ); // Enable support for Custom_Headers add_theme_support( 'custom-header', apply_filters( 'businessdex_custom_header___options', array( 'width' => 1900, 'height' => 800, 'flex-height' => true, 'flex-width' => true, 'header-text' => false ))); // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); // Globals global $businessdex_sections; // Add front-page sections positions $sections_position = get_theme_mod( 'businessdex_sections_position' ); $businessdex_sections = apply_filters( 'businessdex_sections_filter', array() ); if( empty( $sections_position ) && ! empty( $businessdex_sections ) ) { $sections = array(); foreach( $businessdex_sections as $key => $value ) { $sections[] = 'businessdex_section__' . sanitize_key( $value ); } set_theme_mod( 'businessdex_sections_position', $sections ); } // Widgets selective refresh add_theme_support( 'customize-selective-refresh-widgets' ); // WooCommerce theme support add_theme_support( 'woocommerce' ); } } add_action( 'after_setup_theme', 'businessdex_setup' ); /* Handles JavaScript detection. /* ------------------------------------ */ if ( ! function_exists( 'businessdex_javascript_detection' ) ) { function businessdex_javascript_detection() { echo "\n"; } } add_action( 'wp_head', 'businessdex_javascript_detection', 0 ); /* Set the content width in pixels /* ------------------------------------ */ if ( ! function_exists( 'businessdex_content_width' ) ) { function businessdex_content_width() { $GLOBALS['content_width'] = apply_filters( 'businessdex_content_width', 840 ); } } add_action( 'after_setup_theme', 'businessdex_content_width', 0 ); /* Enqueues scripts and styles. /* ------------------------------------ */ if ( ! function_exists( 'businessdex_scripts' ) ) { function businessdex_scripts() { // Google Fonts wp_enqueue_style( 'businessdex-fonts', businessdex_fonts_setup(), array(), null ); // Theme stylesheet wp_enqueue_style( 'businessdex-style', get_stylesheet_uri(), array(), BUSINESSDEX_VERSION ); // Font Awesome wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/icons/css/font-awesome.min.css', array(), '4.7.0', 'all' ); // Javascript wp_enqueue_script( 'businessdex-scripts', get_template_directory_uri() . '/assets/js/scripts.js', array( 'jquery' ), '20160412', true ); // Masonry if( is_page_template( 'template-frontpage.php') || businessdex_jetpack_check( 'custom-content-types' ) ) { wp_enqueue_script( 'jquery-masonry' ); }; // Comments Script if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Some variables wp_localize_script( 'businessdex-scripts', 'businessdex_scripts_data', apply_filters( 'businessdex_frontend_js_data_filter', array( /* Search form placeholder */ 'search_placeholder' => esc_attr_x( 'Type the keywords you are searching for', 'search overlay placeholder', 'businessdex' ), 'home_url' => esc_url( home_url() ), ) ) ); } } add_action( 'wp_enqueue_scripts', 'businessdex_scripts' ); /* Widgets and Sidebars Setup /* ------------------------------------ */ if ( ! function_exists( 'businessdex_sidebars_and_widgets' ) ) { function businessdex_sidebars_and_widgets() { // Normal sidebars register_sidebar( array( // Index sidebar 'name' => __( 'Index Sidebar', 'businessdex' ), 'id' => 'sidebar-index', 'description' => __( 'This sidebar appears where the index/arhives views are shown.', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( // Posts sidebar 'name' => __( 'Posts Sidebar', 'businessdex' ), 'id' => 'sidebar-single', 'description' => __( 'This sidebar appears when you view a post', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( // Page sidebar 'name' => __( 'Page Sidebar', 'businessdex' ), 'id' => 'sidebar-page', 'description' => __( 'This sidebar appears when you view a page', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); if( businessdex_jetpack_check( 'custom-content-types' ) ) { register_sidebar( array( // Portfolio sidebar 'name' => __( 'Portfolio Sidebar', 'businessdex' ), 'id' => 'sidebar-portfolio', 'description' => __( 'This sidebar appears when you view a Jetpack Portfolio item', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } // Footer sidebars register_sidebar( array( // Footer #1 sidebar 'name' => __( 'Footer #1 Sidebar', 'businessdex' ), 'id' => 'sidebar-footer-1', 'description' => __( 'First footer sidebar', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( // Footer #2 sidebar 'name' => __( 'Footer #2 Sidebar', 'businessdex' ), 'id' => 'sidebar-footer-2', 'description' => __( 'Second footer sidebar', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( // Footer #3 sidebar 'name' => __( 'Footer #3 Sidebar', 'businessdex' ), 'id' => 'sidebar-footer-3', 'description' => __( 'Third footer sidebar', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); if( businessdex_wco_is_activated() ) { register_sidebar( array( // Shop sidebar 'name' => __( 'Shop Sidebar', 'businessdex' ), 'id' => 'sidebar-shop', 'description' => __( 'Shop sidebar - index/archive view', 'businessdex' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } } } add_action( 'widgets_init', 'businessdex_sidebars_and_widgets', 20 ); /* Google fonts /* ------------------------------------ */ if ( ! function_exists( 'businessdex_fonts_setup' ) ) { function businessdex_fonts_setup() { $fonts_url = ''; $fonts = array(); $subsets = apply_filters( 'businessdex_fonts___subsets', $subsets = 'latin,latin-ext' ); // Default fonts $fonts[] = 'Poppins:400,700,300'; $fonts[] = 'Roboto:400,300,700,900,300italic,400italic,700italic'; $fonts = apply_filters( 'businessdex_fonts___family', $fonts ); if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', array_map( 'esc_attr', $fonts ) ) ), 'subset' => urlencode( esc_attr( $subsets ) ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } } /* TGM - Recommended plugins /* ------------------------------------ */ if ( ! function_exists( 'businessdex_register_required_plugins' ) ) { function businessdex_register_required_plugins() { $plugins = array( array( 'name' => 'BusinessDex Extensions', 'slug' => 'businessdex-extensions', 'required' => false, ), array( 'name' => 'Jetpack by WordPress.com', 'slug' => 'jetpack', 'required' => false, ), ); $config = array( 'id' => 'businessdex', 'default_path' => '', 'menu' => 'tgmpa-install-plugins', 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '', 'is_automatic' => false, 'message' => '', ); tgmpa( $plugins, $config ); } } add_action( 'tgmpa_register', 'businessdex_register_required_plugins' );