__( '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' => '