array( // Name used in saved option
'label' => __( 'Red', 'modern-business' ), // Label on options panel (required)
'stylesheet' => false, // Stylesheet URL, relative to theme directory (required)
'preview' => '#dc291e', // Preview color on options panel (required)
'default' => true
),
'gray' => array(
'label' => __( 'Gray', 'modern-business' ),
'stylesheet' => '/css/gray-black.css',
'preview' => '#898989',
'deps' => 'modern-business'
)
);
return apply_filters( 'sds_theme_options_color_schemes', $color_schemes );
}
}
/**
* This function registers all web fonts available in this theme.
*/
if ( ! function_exists( 'sds_web_fonts' ) ) {
function sds_web_fonts() {
$web_fonts = array(
// Average Sans
'Lato:400' => array(
'label' => 'Lato',
'css' => 'font-family: \'Lato\', sans-serif;'
)
);
return apply_filters( 'sds_theme_options_web_fonts', $web_fonts );
}
}
/**
* This function registers all content layouts available in this theme.
*/
if ( ! function_exists( 'sds_content_layouts' ) ) {
function sds_content_layouts() {
$content_layouts = array(
'default' => array( // Name used in saved option
'label' => __( 'Default', 'modern-business' ), // Label on options panel (required)
'preview' => '
', // Preview on options panel (required; %1$s is replaced with values below on options panel if specified)
'preview_values' => array( __( 'Default', 'modern-business' ) ),
'default' => true
),
'cols-1' => array( // Full Width
'label' => __( 'Full Width', 'modern-business' ),
'preview' => '',
),
'cols-2' => array( // Content Left, Primary Sidebar Right
'label' => __( 'Content Left', 'modern-business' ),
'preview' => ''
),
'cols-2-r' => array( // Content Right, Primary Sidebar Left
'label' => __( 'Content Right', 'modern-business' ),
'preview' => ''
),
'cols-3' => array( // Content Left, Primary Sidebar Middle, Secondary Sidebar Right
'label' => __( 'Content, Sidebar, Sidebar', 'modern-business' ),
'preview' => ''
),
'cols-3-m' => array( // Primary Sidebar Left, Content Middle, Secondary Sidebar Right
'label' => __( 'Sidebar, Content, Sidebar', 'modern-business' ),
'preview' => ''
),
'cols-3-r' => array( // Primary Sidebar Left, Secondary Sidebar Middle, Content Right
'label' => __( 'Sidebar, Sidebar, Content', 'modern-business' ),
'preview' => ''
)
);
return apply_filters( 'sds_theme_options_content_layouts', $content_layouts );
}
}
/**
* This function sets a default featured image size for use in this theme.
*/
if ( ! function_exists( 'sds_theme_options_default_featured_image_size' ) ) {
add_filter( 'sds_theme_options_default_featured_image_size', 'sds_theme_options_default_featured_image_size' );
function sds_theme_options_default_featured_image_size( $default ) {
return 'mb-780x300';
}
}
/**
* This function modifies the featured image size output based on content layout settings.
*/
if ( ! function_exists( 'sds_featured_image_size' ) ) {
add_filter( 'sds_featured_image_size', 'sds_featured_image_size', 10, 2 );
function sds_featured_image_size( $size, $link_image ) {
global $sds_theme_options;
// Content layout was specified by user in Theme Options
if ( isset( $sds_theme_options['body_class'] ) && ! empty( $sds_theme_options['body_class'] ) ) {
if ( $sds_theme_options['body_class'] === 'cols-1' )
$size = 'mb-1200x475'; // Full width image
}
return $size;
}
}
/**
* This function modifies the global $content_width value based on content layout or page template settings.
*/
if ( ! function_exists( 'mb_body_class' ) ) {
add_filter( 'body_class', 'mb_body_class', 20 );
function mb_body_class( $classes ) {
global $sds_theme_options, $content_width;
// Content layout was specified by user in Theme Options
if ( isset( $sds_theme_options['body_class'] ) && ! empty( $sds_theme_options['body_class'] ) ) {
// 1 Column
if ( $sds_theme_options['body_class'] === 'cols-1' )
$content_width = 1200;
// 3 Columns
else if ( strpos( $sds_theme_options['body_class'], 'cols-3' ) !== false )
$content_width = 600;
}
// Page Template was specified by the user for this page
if ( ! empty( $sds_theme_options['page_template'] ) && $sds_theme_options['page_template'] !== 'default' ) {
// Full Width or Landing Page
if( in_array( $sds_theme_options['page_template'], array( 'page-full-width.php', 'page-landing-page.php' ) ) )
$content_width = 1200;
}
return $classes;
}
}
/**
* This function adds the custom Theme Customizer styles to the tag.
*/
if ( ! function_exists( 'mb_wp_head' ) ) {
add_filter( 'wp_head', 'mb_wp_head', 20 );
function mb_wp_head() {
$sds_theme_options_instance = SDS_Theme_Options_Instance();
?>
Upgrade to Modern Business Pro and receive more color schemes!', 'modern-business' ), esc_url( 'http://slocumthemes.com/wordpress-themes/modern-business/' ) ); ?>
Upgrade to Modern Business Pro to use more web fonts!', 'modern-business' ), esc_url( 'http://slocumthemes.com/wordpress-themes/modern-business-pro/' ) ); ?>
Upgrade to Modern Business Pro to receive priority ticketing support!', 'modern-business' ), esc_url( 'http://slocumthemes.com/wordpress-themes/modern-business-pro/' ) ); ?>
Modern Business Forums on WordPress.org.', 'modern-business' ), esc_url( 'http://wordpress.org/support/theme/modern-business/' ) ); ?>
%2$s by Slocum Studio', 'modern-business' ), esc_url( 'http://slocumthemes.com/wordpress-themes/modern-business/' ), $theme_name );
}
}
/**
* This function outputs mobile a navigation HTML structure combining both the top and primary menu items.
*/
if ( ! function_exists( 'mb_mobile_menu' ) ) {
function mb_mobile_menu() {
global $post, $sds_theme_options;
$nav_menu_locations = get_nav_menu_locations();
?>