__( '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' => '',
'width' => 290,
'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( 'title-tag' );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
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' => __('Albar Footer', 'albar'),
'id' => 'site-footer',
'before_widget' => '',
'before_title' => ''
));
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' ); ?>
__( 'Elementor Page Builder', 'albar' ),
'slug' => 'elementor',
'required' => false,
),
array(
'name' => __( 'WooCommerce', 'albar' ),
'slug' => 'woocommerce',
'required' => false,
),
array(
'name' => __( 'Breadcrumb NavXT', 'albar' ),
'slug' => 'breadcrumb-navxt',
'required' => false,
),
array(
'name' => __( 'Linkt', 'albar' ),
'slug' => 'linkt',
'required' => false,
),
array(
'name' => __( 'HubSpot', 'albar' ),
'slug' => 'leadin',
'required' => false,
)
);
$config = array(
'id' => 'albar',
'menu' => 'tgmpa-install-plugins'
);
tgmpa( $plugins, $config );
}
add_action( 'tgmpa_register', 'kaira_register_required_plugins' );
/* Enque Admin CSS for Conica notice */
function kaira_load_admin_notice_script() {
wp_enqueue_style( 'kaira-admin-notice-css', get_template_directory_uri() . '/settings/css/kaira-admin-notice.css' );
}
add_action( 'admin_enqueue_scripts', 'kaira_load_admin_notice_script' );
/* Display the admin Conica Recommendation notice */
function kaira_recommended_plugin_notice() {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta( $user_id, 'kaira_recommended_plugin_ignore_notice' ) ) {
echo '';
printf( __( '
', 'albar' ), '?kaira_recommended_plugin_nag_ignore=0' ); ?>
LATEST UPDATE: Requires WooCommerce 3.3 or more
We recommend rather trying out our NEW Power theme, Avant - Download and try Avant now Currently on a flash sale for only $19
With 7 header layouts, 5 Blog layouts and 3 Footer layouts, full website color options and lots of other customization settings, you\'ll be able to create the perfect site. All built within the WordPress Customizer.
If not, Albar will still work and we will keep it updated.
', 'albar' ), admin_url( 'theme-install.php?search=avant' ) ); ?>
';
}
}
add_action('admin_notices', 'kaira_recommended_plugin_notice');
/* Dismiss notice */
function kaira_recommended_plugin_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset($_GET['kaira_recommended_plugin_nag_ignore']) && '0' == $_GET['kaira_recommended_plugin_nag_ignore'] ) {
add_user_meta( $user_id, 'kaira_recommended_plugin_ignore_notice', 'true', true );
}
}
add_action('admin_init', 'kaira_recommended_plugin_nag_ignore');