array(
'icon' => 'fa fa-facebook',
'label' => __( 'Facebook', 'baton' )
),
'twitter_url' => array(
'icon' => 'fa fa-twitter',
'label' => __( 'Twitter', 'baton' )
),
'linkedin_url' => array(
'icon' => 'fa fa-linkedin',
'label' => __( 'LinkedIn', 'baton' )
),
'google_plus_url' => array(
'icon' => 'fa fa-google-plus',
'label' => __( 'Google+', 'baton' )
),
'youtube_url' => array(
'icon' => 'fa fa-youtube',
'label' => __( 'YouTube', 'baton' )
),
'vimeo_url' => array(
'icon' => 'fa fa-vimeo-square',
'label' => __( 'Vimeo', 'baton' )
),
'pinterest_url' => array(
'icon' => 'fa fa-pinterest',
'label' => __( 'Pinterest', 'baton' )
),
'instagram_url' => array(
'icon' => 'fa fa-instagram',
'label' => __( 'Instagram', 'baton' )
),
'flickr_url' => array(
'icon' => 'fa fa-flickr',
'label' => __( 'Flickr', 'baton' )
),
'foursquare_url' => array(
'icon' => 'fa fa-foursquare',
'label' => __( 'Foursquare', 'baton' )
),
'rss_url' => array(
'icon' => 'fa fa-rss',
'label' => __( 'RSS', 'baton' )
),
);
$social_font_map = apply_filters( 'sds_social_icon_map', $social_font_map );
?>
array( // Name used in saved option
'label' => __( 'Default', 'baton' ), // 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', 'baton' ) ),
'default' => true
),
'cols-1' => array( // Full Width
'label' => __( 'Full Width', 'baton' ),
'preview' => '',
),
'cols-2' => array( // Content Left, Primary Sidebar Right
'label' => __( 'Content Left', 'baton' ),
'preview' => ''
),
'cols-2-r' => array( // Content Right, Primary Sidebar Left
'label' => __( 'Content Right', 'baton' ),
'preview' => ''
)
);
return apply_filters( 'sds_theme_options_content_layouts', $content_layouts );
}
}
/**
* This function modifies the global $content_width value based on content layout or page template settings.
*/
if ( ! function_exists( 'baton_body_class' ) ) {
add_filter( 'body_class', 'baton_body_class', 20 );
function baton_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 = 1272;
// 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 = 1272;
// Customizer
if ( is_customize_preview() )
$classes['baton-customizer'] = 'customizer';
// Front Page Sidebar/Widgets
if ( is_front_page() ) {
// If the Front Page Sidebar is active
if ( sds_is_front_page_sidebar_active() )
$classes['baton-front-page-sidebar-active'] = 'front-page-sidebar-active';
// Otherwise if Baton demo content or Baton Conductor are enabled
else if ( baton_is_demo_content_enabled() || baton_is_baton_conductor_enabled() )
$classes['baton-front-page-sidebar-default-widgets'] = 'front-page-sidebar-default-widgets';
// If Baton Conductor is enabled
if ( baton_is_baton_conductor_enabled() )
$classes['baton-baton-conductor'] = 'baton-baton-conductor';
// If Conductor is active on the Front Page
if ( class_exists( 'Conductor' ) && Conductor::is_conductor() ) {
// Remove the CSS classes
if ( isset( $classes['baton-front-page-sidebar-active'] ) )
unset( $classes['baton-front-page-sidebar-active'] );
if ( isset( $classes['baton-front-page-sidebar-default-widgets'] ) )
unset( $classes['baton-front-page-sidebar-default-widgets'] );
if ( isset( $classes['baton-baton-conductor'] ) )
unset( $classes['baton-baton-conductor'] );
}
}
return $classes;
}
}
/**
* 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 'baton-1200x9999';
}
}
if ( ! function_exists( 'sds_copyright_branding' ) ) {
add_filter( 'sds_copyright_branding', 'sds_copyright_branding', 10, 2 );
function sds_copyright_branding( $text, $theme_name ) {
return '' . $theme_name . ' by Slocum Studio';
}
}
/**
* This function returns the more link label for Baton.
*/
function baton_more_link_label( $return_default_only = false ) {
// Return default
if ( $return_default_only )
return __( 'Continue Reading', 'baton' );
// Get theme mod
$label = get_theme_mod( 'baton_more_link_label' );
return ( ! empty( $label ) ) ? $label : __( 'Continue Reading', 'baton' );
}
/**
* This function returns the Boolean value of the parameter passed.
*/
if ( ! function_exists( 'baton_boolval' ) ) {
function baton_boolval( $var, $wp_customize_setting = false ) {
return ( bool ) $var;
}
}
/**
* Template for comments and pingbacks.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @param object $comment Comment to display.
* @param array $args Optional args.
* @param int $depth Depth of comment.
*/
if ( ! function_exists( 'baton_comment' ) ) {
function baton_comment( $comment, $args, $depth ) {
// Set the global comment variable to this comment
$GLOBALS['comment'] = $comment;
// Switch based on comment type
switch ( $comment->comment_type ) :
// Pingbacks and Trackbacks
case 'pingback':
case 'trackback':
?>
'primary-nav menu',
'echo' => true,
'show_home' => true,
'link_before' => '',
'link_after' => ''
) );
}
}
/**
* This function outputs a fallback menu for mobile devices and is used when the Primary Menu
* is inactive.
*/
if ( ! function_exists( 'baton_mobile_primary_menu_fallback' ) ) {
function baton_mobile_primary_menu_fallback() {
wp_page_menu( array(
'menu_class' => 'primary-nav primary-nav-mobile menu',
'echo' => true,
'show_home' => true,
'link_before' => '',
'link_after' => ''
) );
}
}
/**
* This function checks to see if Yoast Breadcrumbs are active.
*/
function baton_is_yoast_breadcrumbs_active() {
return ( function_exists( 'yoast_breadcrumb' ) && ( ( $wpseo_internallinks = get_option( 'wpseo_internallinks' ) ) && isset( $wpseo_internallinks['breadcrumbs-enable'] ) && $wpseo_internallinks['breadcrumbs-enable'] ) );
}
/**
* This function registers all color schemes available in this theme.
*/
if ( ! function_exists( 'sds_color_schemes' ) ) {
function sds_color_schemes() {
$color_schemes = array(
// Default (any additional color schemes should contain all of these properties as well as a 'deps' property)
'default' => array( // Name used in saved option
'label' => __( 'Default', 'baton' ), // Label on options panel (required)
'stylesheet' => false, // Stylesheet URL, relative to theme directory (required)
'preview' => '#7cb2c2', // Preview color on options panel (required)
'default' => true,
// Customizer
'background_color' => '#f1f5f9', // Default background color
),
// Blue
'blue' => array(
'label' => __( 'Blue', 'baton' ),
'stylesheet' => '/css/blue.css',
'preview' => '#3f70d4',
'deps' => 'baton',
// Customizer
'background_color' => '#ffffff', // Default background color
),
// Green
'green' => array(
'label' => __( 'Green', 'baton' ),
'stylesheet' => '/css/green.css',
'preview' => '#66bc7d',
'deps' => 'baton',
// Customizer
'background_color' => '#f1f5f9', // Default background color
),
// Red
'red' => array(
'label' => __( 'Red', 'baton' ),
'stylesheet' => '/css/red.css',
'preview' => '#ff5b5d',
'deps' => 'baton',
// Customizer
'background_color' => '#ffffff', // Default background color
)
);
return apply_filters( 'sds_theme_options_color_schemes', $color_schemes );
}
}
/**
* This determines if Baton demo content is enabled.
*/
function baton_is_demo_content_enabled() {
return ( get_theme_mod( 'baton_disable_demo_content' ) === false );
}
/**
* This determines if Baton Conductor is enabled.
*/
function baton_is_baton_conductor_enabled() {
// Grab the Baton_Conductor instance
$baton_conductor = Baton_Conductor_Instance();
return $baton_conductor->is_baton_conductor_enabled();
}
/**
* This function displays default Front Page Sidebar widgets.
*/
function baton_default_widgets() {
get_template_part( 'default-widget', 'note-baton-hero-1' ); // Note Baton Hero 1
get_template_part( 'default-widget', 'note-baton-features-1' ); // Note Baton Feature 1
get_template_part( 'default-widget', 'note-baton-hero-2' ); // Note Baton Hero 2
}
/**
* This determines if a Static Front Page is selected.
*/
function baton_has_static_front_page() {
return ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_on_front' ) );
}
/*
* SDS Core
*/
if ( ! function_exists( 'sds_theme_options_ads' ) ) {
add_action( 'sds_theme_options_ads', 'sds_theme_options_ads' );
function sds_theme_options_ads() {
?>
Baton
★★★★★ on
WordPress.org.', 'baton' ), 'https://wordpress.org/support/view/theme-reviews/baton?filter=5' ); ?>
%2$s by Slocum Studio', 'baton' ), esc_url( 'https://slocumthemes.com/wordpress-themes/baton/' ), $theme_name );
}
}
if ( ! function_exists( 'sds_about_page_pro_color_schemes_count' ) ) {
add_filter( 'sds_about_page_pro_color_schemes_count', 'sds_about_page_pro_color_schemes_count' );
function sds_about_page_pro_color_schemes_count( $count ) {
return 4;
}
}
if ( ! function_exists( 'sds_about_page_pro_content_layouts_count' ) ) {
add_filter( 'sds_about_page_pro_content_layouts_count', 'sds_about_page_pro_content_layouts_count' );
function sds_about_page_pro_content_layouts_count( $count ) {
return 3;
}
}
if ( ! function_exists( 'sds_about_page_free_vs_pro_table' ) ) {
add_filter( 'sds_about_page_free_vs_pro_table', 'sds_about_page_free_vs_pro_table' );
function sds_about_page_free_vs_pro_table() {
/*
* Individual Colors
*/
?>
|
|
|
|
|
|
|
|
|
|
|
|