__( 'Main Menu', 'albar' )
) );
add_theme_support('post-thumbnails');
if ( function_exists( 'add_image_size' ) ) {
add_image_size('blog_standard_img', 580, 380, true );
}
// The custom header is used for the logo
add_theme_support('custom-header', array(
'default-image' => get_template_directory_uri() . '/images/albar_logo.png',
'width' => 300,
'height' => 110,
'flex-width' => true,
'flex-height' => true,
'header-text' => false,
));
add_editor_style();
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
add_theme_support( 'custom-background', array( 'default-color' => '#ffffff', ) );
add_theme_support( 'woocommerce' );
}
endif; // kaira_setup
add_action( 'after_setup_theme', 'kaira_setup_theme' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function kaira_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'albar' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar(array(
'name' => __('Alba Footer', 'albar'),
'id' => 'site-footer',
));
register_widget( 'alba_carousel' );
register_widget( 'alba_heading' );
register_widget( 'alba_icon' );
}
add_action( 'widgets_init', 'kaira_widgets_init' );
if(!function_exists('kaira_footer_widget_params')):
/**
* Set the widths of the footer widgets
*
* @param $params
* @return mixed
*
* @filter dynamic_sidebar_params
*/
function kaira_footer_widget_params($params){
// Check that this is the footer
if($params[0]['id'] != 'site-footer') return $params;
$sidebars_widgets = wp_get_sidebars_widgets();
$count = count($sidebars_widgets[$params[0]['id']]);
$params[0]['before_widget'] = preg_replace('/\>$/', ' style="width:'.round(100/$count,4).'%" >', $params[0]['before_widget']);
return $params;
}
endif;
add_filter('dynamic_sidebar_params', 'kaira_footer_widget_params');
function kaira_print_styles(){
$custom_css = '';
if ( kaira_theme_option( 'kra-custom-css' ) ) {
$custom_css = kaira_theme_option( 'kra-custom-css' );
}
$body_font = kaira_theme_option( 'kra-body-google-font-name' );
$body_font_color = kaira_theme_option( 'kra-body-google-font-color' );
$h_font = kaira_theme_option( 'kra-heading-google-font-name' );
$h_font_color = kaira_theme_option( 'kra-heading-google-font-color' );
$primary_color = kaira_theme_option( 'kra-primary-color' );
$primary_color_hover = kaira_theme_option( 'kra-primary-color-hover' ); ?>
';
}
function kaira_wrap_woocommerce_end() {
echo '';
}