',
)
);
/* Footer widget area */
register_sidebar(
array(
'name' => esc_html__( 'Footer 1', 'one-page-business' ),
'id' => 'footer-sidebar-1',
'description' => esc_html__( 'Add widgets here to appear in your footer.', 'one-page-business' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 2', 'one-page-business' ),
'id' => 'footer-sidebar-2',
'description' => esc_html__( 'Add widgets here to appear in your footer.', 'one-page-business' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 3', 'one-page-business' ),
'id' => 'footer-sidebar-3',
'description' => esc_html__( 'Add widgets here to appear in your footer.', 'one-page-business' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer 4', 'one-page-business' ),
'id' => 'footer-sidebar-4',
'description' => esc_html__( 'Add widgets here to appear in your footer.', 'one-page-business' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
)
);
}
add_action( 'widgets_init', 'one_page_business_widgets_init' );
/**
* @since 1.0.0
* An error notice that can be displayed if the Minimum PHP version is not met.
*/
function one_page_business_php_not_met_notice() {
?>
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;
/**
* Handles JavaScript detection.
* Adds a `js` class to the root `` element when JavaScript is detected.
*/
function one_page_business_javascript_detection() {
echo "\n";
}
add_action( 'wp_head', 'one_page_business_javascript_detection', 0 );
/**
* @since 1.0.0
* Switches back to the previous theme if the minimum PHP version is not met.
*/
function one_page_business_test_for_min_php() {
// Compare versions.
if ( version_compare( PHP_VERSION, one_page_business_php_version, '<' ) ) {
// Site doesn't meet themes min php requirements, add notice...
add_action( 'admin_notices', 'one_page_business_php_not_met_notice' );
// ... and switch back to previous theme.
switch_theme( get_option( 'theme_switched' ) );
return false;
};
}
/**
* Enqueues scripts and styles.
*/
function one_page_business_scripts() {
// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'one-page-business-fonts', one_page_business_fonts_url(), array(), null );
wp_enqueue_style( 'bootstrap', get_theme_file_uri( '/css/bootstrap.css' ), array(), '3.3.6');
// Add FontAwesome, used in the main stylesheet.
wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/fonts/font-awesome/css/font-awesome.css', array(), '3.4.1' );
// Theme stylesheet.
wp_enqueue_style( 'one-page-business-style', get_stylesheet_uri() );
// Load the html5 shiv.
wp_enqueue_script( 'one-page-business-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' );
wp_script_add_data( 'one-page-business-html5', 'conditional', 'lt IE 9' );
wp_enqueue_script( 'one-page-business-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20191010', true );
wp_enqueue_script( 'bootstrap', get_theme_file_uri( '/js/bootstrap.js' ), array( 'jquery' ), '3.3.7', true);
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
if ( is_singular() && wp_attachment_is_image() ) {
wp_enqueue_script( 'one-page-business-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160816' );
}
//Pro styles and widgets
one_page_business_styles();
wp_enqueue_script( 'one-page-business-script', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20191010', true );
wp_localize_script(
'one-page-business-script',
'onePageBusinesScreenReaderText',
array(
'expand' => esc_html__( 'Expand child menu', 'one-page-business' ),
'collapse' => esc_html__( 'Collapse child menu', 'one-page-business' ),
)
);
}
add_action( 'wp_enqueue_scripts', 'one_page_business_scripts' );
/**
* Enqueue styles, scripts for pro version
*/
function one_page_business_styles(){
wp_enqueue_style( 'pro-css', get_theme_file_uri( '/pro/pro-style.css' ), array() );
}
require get_template_directory() . '/inc/breadcrumb-class.php';
/**
* Enqueue styles for the block-based editor.
*/
function one_page_business_block_editor_styles() {
// Add custom fonts.
wp_enqueue_style( 'one-page-business-fonts', one_page_business_fonts_url(), array(), null );
}
add_action( 'enqueue_block_editor_assets', 'one_page_business_block_editor_styles' );
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* @since 1.0.0
* Set a constant that holds the theme's minimum supported PHP version.
*/
define( 'one_page_business_php_version', '5.6' );
/**
* Immediately after theme switch is fired we we want to check php version and
* revert to previously active theme if version is below our minimum.
*/
add_action( 'after_switch_theme', 'one_page_business_test_for_min_php' );
// Display fontawesome search icon in menus and toggle search form
add_filter('wp_nav_menu_items', 'one_page_business_search_form', 10, 2);
function one_page_business_search_form($items, $args) {
if( $args->theme_location == 'primary' )
$items .= '