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' );
add_image_size( 'small-image', 340, 200, true );
add_image_size( 'large-image', 848, 400, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'bwp' ),
) );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'footer-menu' => esc_html__( 'Footer Menu', 'bwp' ),
) );
/*
* 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',
) );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'bwp_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif; // bwp_setup
add_action( 'after_setup_theme', 'bwp_setup' );
/**
* 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 bwp_content_width() {
$GLOBALS['content_width'] = apply_filters( 'bwp_content_width', 640 );
}
add_action( 'after_setup_theme', 'bwp_content_width', 0 );
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
add_editor_style( get_stylesheet_uri() );
}
// Add WooCommerce support.
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
add_theme_support( 'woocommerce' );
}
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function bwp_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'bwp' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Sidebar Left', 'bwp' ),
'id' => 'sidebar-left',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Contact', 'bwp' ),
'id' => 'sidebar-contact',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 1', 'bwp' ),
'id' => 'sidebar-footer-1',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 2', 'bwp' ),
'id' => 'sidebar-footer-2',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 3', 'bwp' ),
'id' => 'sidebar-footer-3',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer 4', 'bwp' ),
'id' => 'sidebar-footer-4',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'bwp_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function bwp_scripts() {
wp_enqueue_style( 'bwp-bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.5', 'all' );
wp_enqueue_style( 'bwp-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.4.0', 'all' );
wp_enqueue_style( 'bwp-animate', get_template_directory_uri() . '/css/animate.css', array(), '2015', 'all' );
wp_enqueue_style( 'google-heading', '//fonts.googleapis.com/css?family=Raleway:400,300,700' );
wp_enqueue_style( 'google-body', '//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,700italic,400italic' );
wp_enqueue_style( 'bwp-style', get_stylesheet_uri() );
wp_enqueue_script( 'bwp-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.5', true );
wp_enqueue_script( 'bwp-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );
wp_enqueue_script( 'bwp-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
wp_enqueue_script( 'bwp-wow', get_template_directory_uri() . '/js/wow.js', array(), '1.1.2', true );
wp_enqueue_script( 'bwp-custom-js', get_template_directory_uri() . '/js/custom.js', array(), '1.0', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'bwp_scripts' );
/**
* Add Respond.js for IE
*/
if( !function_exists('ie_scripts')) {
function ie_scripts() {
echo '';
echo ' ';
echo ' ';
}
add_action('wp_head', 'ie_scripts');
} // end if
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Load Bootstrap Menu.
*/
require get_template_directory() . '/inc/bootstrap-walker.php';
/**
* Comments Callback.
*/
require get_template_directory() . '/inc/comments-callback.php';
/**
* Author Meta.
*/
require get_template_directory() . '/inc/author-meta.php';
/**
* Search Results - Highlight.
*/
require get_template_directory() . '/inc/search-highlight.php';