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' );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
add_theme_support( 'woocommerce' );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Enqueue editor styles.
add_editor_style( 'style-editor.css' );
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
/**
* Add support for core custom logo.
*/
add_theme_support( 'custom-logo', array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
) );
// Add support for Custom Header.
add_theme_support( 'custom-header', apply_filters( 'bevro_custom_header_args', array(
'default-image' => '',
'flex-height' => true,
'header-text' => false,
) ) );
// Add support for Custom Background.
$args = array(
'default-color' => 'f1f1f1',
);
add_theme_support( 'custom-background',$args );
// Recommend plugins
add_theme_support( 'recommend-plugins', array(
'elementor' => array(
'name' => esc_html__( 'Elementor', 'bevro' ),
'active_filename' => 'elementor/elementor.php',
),
'contact-form-7' => array(
'name' => esc_html__( 'Contact Form 7', 'bevro' ),
'active_filename' => 'contact-form-7/wp-contact-form-7.php',
),
'woocommerce' => array(
'name' => esc_html__( 'Woocommerce', 'bevro' ),
'active_filename' => 'woocommerce/woocommerce.php',
),
'one-click-demo-import' => array(
'name' => esc_html__( 'One Click Demo Import', 'bevro' ),
'active_filename' => 'one-click-demo-import/one-click-demo-import.php',
),
'business-popup' => array(
'name' => esc_html__( 'Business Popup', 'gogo' ),
'active_filename' => 'business-popup/business-popup.php',
)
) );
}
endif;
add_action( 'after_setup_theme', 'bevro_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 bevro_content_width(){
$GLOBALS['content_width'] = apply_filters('bevro_content_width', 640 );
}
add_action('after_setup_theme', 'bevro_content_width', 0 );
/**
* Register widget area.
*/
function bevro_widgets_init(){
register_sidebar( array(
'name' => esc_html__( 'Primary Sidebar', 'bevro' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here to appear in your primary sidebar.', 'bevro' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar(array(
'name' => esc_html__( 'Above Header First Widget', 'bevro' ),
'id' => 'top-header-widget-col1',
'description' => esc_html__( 'Add widgets here to appear in top header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Above Header Second Widget', 'bevro' ),
'id' => 'top-header-widget-col2',
'description' => esc_html__( 'Add widgets here to appear in top header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Above Header Third Widget', 'bevro' ),
'id' => 'top-header-widget-col3',
'description' => esc_html__( 'Add widgets here to appear in top header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Below Header First Widget', 'bevro' ),
'id' => 'bottom-header-widget-col1',
'description' => esc_html__( 'Add widgets here to appear in below header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Below Header Second Widget', 'bevro' ),
'id' => 'bottom-header-widget-col2',
'description' => esc_html__( 'Add widgets here to appear in below header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Below Header Third Widget', 'bevro' ),
'id' => 'bottom-header-widget-col3',
'description' => esc_html__( 'Add widgets here to appear in below header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Main Header Widget', 'bevro' ),
'id' => 'main-header-widget',
'description' => esc_html__( 'Add widgets here to appear in main header.', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Footer Top First Widget', 'bevro' ),
'id' => 'footer-top-first',
'description' => esc_html__( 'Add widgets here to appear in Top Footer', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Footer Top Second Widget', 'bevro' ),
'id' => 'footer-top-second',
'description' => esc_html__( 'Add widgets here to appear in Top Footer', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Footer Top Third Widget', 'bevro' ),
'id' => 'footer-top-third',
'description' => esc_html__( 'Add widgets here to appear in Top Footer', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Footer Below First Widget', 'bevro' ),
'id' => 'footer-bottom-first',
'description' => esc_html__( 'Add widgets here to appear in below footer', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Footer Below Second Widget', 'bevro' ),
'id' => 'footer-bottom-second',
'description' => esc_html__( 'Add widgets here to appear in below footer','bevro' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => esc_html__( 'Footer Below Third Widget', 'bevro' ),
'id' => 'footer-bottom-third',
'description' => esc_html__( 'Add widgets here to appear in below Footer', 'bevro' ),
'before_widget' => '',
'before_title' => '',
) );
for ( $i = 1; $i <= 4; $i++ ){
register_sidebar( array(
'name' => sprintf( esc_html__( 'Footer Widget Area %d', 'bevro' ), $i ),
'id' => 'footer-' . $i,
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
}
add_action( 'widgets_init', 'bevro_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function bevro_scripts(){
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style( 'font-awesome-new', get_template_directory_uri() . '/third-party/font-awesome/css/fontawesome-all.css', '', '1.0.0' );
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/third-party/font-awesome/css/font-awesome.css', '', '4.7.0' );
wp_enqueue_style('bevro-menu-style', get_template_directory_uri() . '/css/bevro-menu.css', '', '4.7.0' );
wp_enqueue_style('bevro-style', get_stylesheet_uri(), array(), '1.0.2' );
wp_add_inline_style('bevro-style', bevro_typography_style());
wp_add_inline_style('bevro-style', bevro_custom_style());
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ){
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_script( 'bevro-menu-js', get_parent_theme_file_uri().'/js/bevro-menu.js', array( 'jquery' ), '', true );
if (class_exists( 'WooCommerce' ) ){
wp_enqueue_script( 'bevro-woocommerce-js', get_parent_theme_file_uri().'/inc/woocommerce/js/woocommerce.js', array( 'jquery' ), '', true );
}
wp_enqueue_script( 'bevro-custom-js', get_parent_theme_file_uri().'/js/custom.js', array( 'jquery' ), '', true );
}
add_action( 'wp_enqueue_scripts', 'bevro_scripts' );
/**
* Fix skip link focus in IE11.
*
* This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded.
*
* @link https://git.io/vWdr2
*/
function bevro_skip_link_focus_fix() {
// The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`.
?>