array( 'url' => '%s/assets/images/home_page_header.jpg', 'thumbnail_url' => '%s/assets/images/home_page_header.jpg', 'description' => __('Homepage Header Image', 'business-express'), ), 'default-image' => array( 'url' => '%s/assets/images/page_header.jpg', 'thumbnail_url' => '%s/assets/images/page_header.jpg', 'description' => __('Default Header Image', 'business-express'), ), )); add_theme_support('custom-header', apply_filters('business_express_custom_header_args', array( 'default-image' => get_template_directory_uri() . "/assets/images/page_header.jpg", 'width' => 1920, 'height' => 800, 'flex-height' => true, 'flex-width' => true, 'header-text' => false, ))); add_theme_support('custom-logo', array('height' => 70)); register_nav_menus(array( 'primary' => __('Primary Menu', 'business-express'), )); } add_action('after_setup_theme', 'business_express_setup'); function business_express_sanitize_checkbox($val){ return (isset($val) && $val == true ? true : false); } function business_express_print_contact() { $business_express_contact_email = get_theme_mod("business_express_email", ''); $business_express_contact_phone = get_theme_mod("business_express_phone", ''); if (current_user_can('edit_theme_options')) { if ( empty( $business_express_contact_email )) { $business_express_contact_email = 'add email address'; } if ( empty( $business_express_contact_phone )) { $business_express_contact_phone = 'add phone number'; } } if ( !empty( $business_express_contact_email ) || !empty( $business_express_contact_phone )) { printf('', __("Any questions? ", "business-express")); if ( !empty( $business_express_contact_phone )) { printf('%2$s', esc_url($business_express_contact_phone), wp_kses_post($business_express_contact_phone)); } if ( !empty( $business_express_contact_email )) { printf(' %2$s', esc_url($business_express_contact_email), wp_kses_post($business_express_contact_email)); } } } /** * Add customizer controls */ function business_express_customize_register_action($wp_customize) { $wp_customize->add_setting('business_express_homepage_header', array('sanitize_callback' => 'esc_url_raw', 'default' => get_template_directory_uri() . "/assets/images/home_page_header.jpg")); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'business_express_homepage_header', array( 'label' => __('Home page header', 'business-express'), 'section' => 'header_image', 'settings' => 'business_express_homepage_header', 'priority' => 10, ))); $wp_customize->add_section( 'business_express_header', array( 'title' => esc_html__( 'Header Options', 'business-express' ), 'priority' => 20, ) ); $wp_customize->add_setting( 'business_express_phone', array( 'default' => '#', 'sanitize_callback' => 'wp_kses_post', )); $wp_customize->add_control( 'business_express_phone', array( 'label' => __('Phone', 'business-express'), 'section' => 'business_express_header', 'priority' => 1, )); $wp_customize->add_setting( 'business_express_email', array( 'default' => '#', 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'business_express_email', array( 'label' => __('Email', 'business-express'), 'section' => 'business_express_header', 'priority' => 1, ) ); $business_express_contact = array( 'facebook' => __('Facebook url', 'business-express'), 'twitter' => __('Twitter url', 'business-express'), 'google-plus' => __('GooglePlus url', 'business-express'), 'youtube' => __('Youtube url', 'business-express'), 'skype' => __('Skype url', 'business-express'), 'behance' => __('Behance url', 'business-express') ); foreach ($business_express_contact as $name => $label) { $wp_customize->add_setting( 'business_express_'.$name, array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'business_express_'.$name, array( 'label' => $label, 'section' => 'business_express_header', 'priority' => 1, ) ); } } add_action('customize_register', 'business_express_customize_register_action'); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function business_express_pingback_header() { if ( is_singular() && pings_open() ) { printf( '' . "\n", esc_url(get_bloginfo( 'pingback_url' )) ); } } add_action( 'wp_head', 'business_express_pingback_header' ); /** * Register sidebar */ function business_express_widgets_init() { register_sidebar(array( 'name' => __('Sidebar widget area', 'business-express'), 'id' => 'sidebar-1', 'before_widget' => '
', 'before_title' => '