esc_html__( 'Primary', 'business-trust' ),
'secondary' => esc_html__( 'Secondary', 'business-trust' ),
'social' => esc_html__( 'Social Links Menu', 'business-trust' ),
) );
/*
* 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',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'business_trust_custom_background_args', array(
'default-color' => '#ffffff',
'default-image' => '',
) ) );
// Set up the WordPress core custom header feature.
add_theme_support( 'custom-header', apply_filters( 'business_trust_custom_header_args', array(
'default-image' => BUSINESS_TRUST_TEMPLATE_DIR_URI . '/images/header.jpg',
'width' => 1400,
'height' => 320,
'flex-height' => true,
'header-text' => false,
) ) );
// Enable support for footer widgets.
add_theme_support( 'footer-widgets', 4 );
// Load Supports.
global $business_trust_default_options;
$business_trust_default_options = business_trust_get_default_theme_options();
}
endif;
add_action( 'after_setup_theme', 'business_trust_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 business_trust_content_width() {
$GLOBALS['content_width'] = apply_filters( 'business_trust_content_width', 640 );
}
add_action( 'after_setup_theme', 'business_trust_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function business_trust_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Blog', 'business-trust' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets to appear in your Primary Sidebar.', 'business-trust' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar(
array(
'name' => __( 'WooCommerce Sidebar', 'business-trust' ),
'id' => 'woo-sidebar',
'description' => __( 'Add widgets here to appear in WooCommerce pages.', 'business-trust' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 1', 'business-trust' ),
'id' => 'footer-sidebar-1',
'description' => __( 'Add widgets here to appear in your footer.', 'business-trust' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 2', 'business-trust' ),
'id' => 'footer-sidebar-2',
'description' => __( 'Add widgets here to appear in your footer.', 'business-trust' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 3', 'business-trust' ),
'id' => 'footer-sidebar-3',
'description' => __( 'Add widgets here to appear in your footer.', 'business-trust' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer 4', 'business-trust' ),
'id' => 'footer-sidebar-4',
'description' => __( 'Add widgets here to appear in your footer.', 'business-trust' ),
'before_widget' => '',
'before_title' => '',
)
);
}
add_action( 'widgets_init', 'business_trust_widgets_init' );
if ( ! function_exists( 'business_trust_fonts_url' ) ) :
/**
* Register Google fonts.
*
* @since Business Trust 1.0
*
* @return string Google fonts URL for the theme.
*/
function business_trust_fonts_url() {
$fonts_url = '';
$typography = _x( 'on', 'Open Sans font: on or off', 'business-trust' );
if ( 'off' !== $typography ) {
$font_families = array();
$font_families[] = 'Roboto'.':300,400,500'; //header
$font_families[] = 'Lato'.':300,400,500'; //body
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url( $fonts_url );
}
endif;
/**
* Enqueue scripts and styles.
*/
function business_trust_scripts() {
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$fonts_url = business_trust_fonts_url();
if ( ! empty( $fonts_url ) ) {
wp_enqueue_style( 'business-trust-google-fonts', $fonts_url, array(), null );
}
wp_enqueue_style( 'font-awesome', BUSINESS_TRUST_TEMPLATE_DIR_URI .'/assets/css/font-awesome' . $min . '.css', '', '2.2.1' );
wp_enqueue_style( 'bootstrap-css', BUSINESS_TRUST_TEMPLATE_DIR_URI.'/assets/css/bootstrap.min.css', array(), '3.3.6' );
wp_enqueue_style( 'business-trust-style', get_stylesheet_uri(), array(), '1.0.4' );
wp_enqueue_script( 'boostrap-js', BUSINESS_TRUST_TEMPLATE_DIR_URI.'/assets/js/bootstrap.js', array( 'jquery' ), '3.3.7', true);
wp_enqueue_script( 'business-trust-skip-link-focus-fix', BUSINESS_TRUST_TEMPLATE_DIR_URI . '/assets/js/skip-link-focus-fix' . $min . '.js', array(), '1.2.0', true );
wp_enqueue_script( 'matchHeight', BUSINESS_TRUST_TEMPLATE_DIR_URI . '/assets/js/jquery.matchHeight.js', array( 'jquery' ), '0.7.2', true );
wp_enqueue_script( 'business-trust-custom', BUSINESS_TRUST_TEMPLATE_DIR_URI . '/assets/js/navigation.js', array( 'jquery' ), '1.0.4', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'business_trust_scripts' );
/**
* Custom template tags for this theme.
*/
require_once get_template_directory() . '/inc/template-tags.php';
/**
* Custom template tags for this theme.
*/
require_once get_template_directory() . '/inc/jetpack.php';
/**
* Load TGM pluin activation file.
*/
require_once get_template_directory() . '/inc/class-tgm-plugin-activation.php';
/**
* Customizer additions.
*/
require_once get_template_directory() . '/inc/customizer.php';
function business_trust_nav_wrap() {
$wrap = '';
$wrap .= ' ';
$wrap .= '%3$s';
$wrap .= '
';
return $wrap;
}
/**
*TGM Plugin activation.
*/
add_action( 'tgmpa_register', 'business_trust_activate_recommended_plugins' );
/**
* Register recommended plugins.
*/
function business_trust_activate_recommended_plugins() {
$plugins = array(
array(
'name' => __( 'WooCommerce', 'business-trust' ),
'slug' => 'woocommerce',
'required' => false,
),
array(
'name' => __( 'Elementor Page Builder', 'business-trust' ),
'slug' => 'elementor',
'required' => false,
),
array(
'name' => __( 'Contact Form 7', 'business-trust' ),
'slug' => 'contact-form-7',
'required' => false,
),
);
$config = array();
tgmpa( $plugins, $config );
}
/**
* Display custom font CSS.
*/
function business_trust_fonts_css_container() {
require( get_parent_theme_file_path( '/inc/google-fonts.php' ) );
?>