'sidebar',
'name' => esc_attr__( 'Sidebar', 'awa' ),
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
'description' => esc_attr__( 'Drag the widgets for sidebars.', 'awa' )
)
);
register_sidebar(
array(
'id' => 'shop_sidebar',
'name' => esc_attr__( 'Shop Sidebar', 'awa' ),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
'description' => esc_attr__( 'Drag the widgets for sidebars.', 'awa' )
)
);
register_sidebar(
array(
'id' => 'footer_sidebar',
'name' => esc_attr__( 'Footer Modern Sidebar', 'awa' ),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
'description' => esc_attr__( 'Drag the widgets for sidebars.', 'awa' )
)
);
if( function_exists( 'cs_framework_init' )){
register_sidebar(
array(
'id' => 'footer_simple_sidebar',
'name' => esc_attr__( 'Footer Simple Sidebar', 'awa' ),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
'description' => esc_attr__( 'Drag the widgets for sidebars.', 'awa' )
)
);
}
}
}
function awa_enqueue_main_style() {
global $post;
if( is_page() || is_home()) {
$post_id = get_queried_object_id();
} else {
$post_id = get_the_ID();
}
wp_enqueue_style( 'awa_dynamic-css', admin_url( 'admin-ajax.php' ) . '?action=awa_dynamic_css&post=' . $post_id , array('awa-theme-css') );
}
/*
Register Fonts
*/
if ( ! function_exists( 'awa_fonts_url' ) ) {
function awa_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== esc_html_x( 'on', 'Google font: on or off', 'awa' ) ) {
$fonts = array(
'Muli:200,300,400,600,700,800,900',
'Playfair Display:400,900'
);
$font_url = add_query_arg( 'family',
urlencode( implode( '|', $fonts ) . "&subset=latin,latin-ext" ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
}
/*
Enqueue scripts and styles.
*/
if ( ! function_exists( 'awa_font_scripts' ) ) {
function awa_font_scripts() {
wp_enqueue_style( 'awa-fonts', awa_fonts_url(), array(), '1.0.0' );
}
}
if ( ! function_exists( 'awa_wp_body_classes' ) ) {
function awa_wp_body_classes( $classes ) {
global $bodyClass;
$bodyClass = explode(' ', $bodyClass);
foreach ($bodyClass as $class){
$classes[] = $class;
}
return $classes;
}
}
add_filter( 'body_class','awa_wp_body_classes' );
/**
/**
* @ return null
* @ param none
* @ loads all the js and css script to frontend
**/
if ( ! function_exists( 'awa_enqueue_scripts' ) ) {
function awa_enqueue_scripts() {
// general settings
if ( ( is_admin() ) ) {
return;
}
wp_enqueue_style( 'awa-fonts', awa_fonts_url(), array(), '1.0.0' );
wp_enqueue_script( 'modernizr', AWA_T_URI . '/assets/js/lib/modernizr-2.6.2.min.js', array( 'jquery' ), '', false );
wp_enqueue_script( 'awa-scripts', AWA_T_URI . '/assets/js/lib/scripts.js', array( 'jquery' ), '',false );
wp_enqueue_script( 'countdown', AWA_T_URI . '/assets/js/jquery.countdown.min.js', '', '', true );
wp_enqueue_script( 'awa-foxlazy', AWA_T_URI . '/assets/js/foxlazy.js', array( 'jquery' ),'', true );
wp_enqueue_script( 'easings', AWA_T_URI . '/assets/js/jquery.easings.min.js','','', true );
wp_enqueue_script( 'multiscroll', AWA_T_URI . '/assets/js/jquery.multiscroll.min.js','','', true );
wp_enqueue_script( 'magnific', AWA_T_URI . '/assets/js/magnific.js', '', '', true );
wp_enqueue_script( 'tween-max', AWA_T_URI . '/assets/js/TweenMax.min.js','', '', true );
wp_enqueue_script( 'equalHeightsPlugin', AWA_T_URI . '/assets/js/equalHeightsPlugin.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'fancybox', AWA_T_URI . '/assets/js/jquery.fancybox.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'fitvids', AWA_T_URI . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'swiper3', AWA_T_URI . '/assets/js/swiper3.js', array( 'jquery' ),'', true );
wp_enqueue_script( 'imagesloaded', AWA_T_URI . '/assets/js/imagesloaded.pkgd.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'fragment', AWA_T_URI . '/assets/js/fragment.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'scrollMonitor', AWA_T_URI . '/assets/js/scrollMonitor.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'awa-slider-transition-init', AWA_T_URI . '/assets/js/slider-transition.js', array( 'jquery' ), '', true );
if( ! function_exists( 'cs_framework_init' )){
wp_enqueue_script( 'mousewheel', AWA_T_URI . '/assets/lib/js/jquery.mousewheel.min.js', array( 'jquery' ), '', true);
wp_enqueue_script( 'lightgallery', AWA_T_URI . '/assets/lib/js/lightgallery.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'justified-gallery', AWA_T_URI . '/assets/lib/js/jquery.justifiedGallery.js', array( 'jquery' ), '', true );
}
wp_enqueue_script( 'awa-slick', AWA_T_URI . '/assets/js/slick.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'sliphover', AWA_T_URI . '/assets/js/jquery.sliphover.min.js', array( 'jquery' ),'', true );
wp_enqueue_script( 'thumbnails-popup', AWA_T_URI . '/assets/js/lib/thumbnails-popup.js', array( 'jquery', 'dgwt-jg-lightgallery' ),'', true );
wp_enqueue_script( 'awa-pixi', AWA_T_URI . '/assets/js/pixi.min.js', array( 'jquery' ),'', true );
wp_enqueue_script( 'awa-main-js', AWA_T_URI . '/assets/js/script.js', array( 'jquery' ), '', true );
// add TinyMCE style
add_editor_style();
// including jQuery plugins
wp_localize_script( 'jquery', 'get',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'siteurl' => get_template_directory_uri(),
)
);
if ( is_singular() ) {
wp_enqueue_script( 'comment-reply' );
}
// register style
wp_enqueue_style( 'awa_base_css', AWA_T_URI . '/style.css' );
wp_enqueue_style( 'magnific-popup', AWA_T_URI . '/assets/css/magnific-popup.css' );
wp_enqueue_style( 'animsition', AWA_T_URI . '/assets/css/animsition.min.css' );
wp_enqueue_style( 'bootstrap', AWA_T_URI . '/assets/css/bootstrap.min.css' );
wp_enqueue_style( 'animate-css', AWA_T_URI . '/assets/css/animate.css' );
wp_enqueue_style( 'font-awesome-css', AWA_T_URI . '/assets/css/font-awesome.min.css' );
wp_enqueue_style( 'pe-icon-7-stroke', AWA_T_URI . '/assets/css/pe-icon-7-stroke.css' );
wp_enqueue_style( 'fancybox', AWA_T_URI . '/assets/css/jquery.fancybox.min.css' );
wp_enqueue_style( 'swiper3', AWA_T_URI . '/assets/css/swiper3.css' );
wp_enqueue_style( 'simple-fonts', AWA_T_URI . '/assets/css/simple-line-icons.css' );
wp_enqueue_style( 'ionicons', AWA_T_URI . '/assets/css/ionicons.min.css' );
wp_enqueue_style( 'awa-slick-css', AWA_T_URI . '/assets/css/slick.css' );
wp_enqueue_style( 'awa-theme-css', AWA_T_URI . '/assets/css/awa.min.css' );
if( ! function_exists( 'cs_framework_init' )){
wp_enqueue_style( 'admin-style', AWA_T_URI . '/assets/lib/css/admin-style.css' );
wp_enqueue_style( 'lightgallery', AWA_T_URI . '/assets/lib/css/lightgallery.min.css' );
wp_enqueue_style( 'libs-style', AWA_T_URI . '/assets/lib/css/style.css' );
}
wp_enqueue_style( 'awa-theme-css', AWA_T_URI . '/assets/css/awa.min.css' );
/* Add Custom JS */
if ( cs_get_option( 'custom_js_scripts' ) ) {
wp_add_inline_script( 'awa-main-js', cs_get_option( 'custom_js_scripts' ) );
}
if ( cs_get_option( 'enable_lazy_load' ) ) {
wp_localize_script( 'awa-main-js', 'enable_foxlazy', 'enable' );
}
if ( cs_get_option('heading') ) {
foreach (cs_get_option('heading') as $key => $title) {
if ( empty( $title['heading_family'] )) continue;
$font_family = $title['heading_family'];
if(! empty($font_family['family']) ) {
wp_enqueue_style( sanitize_title_with_dashes($font_family['family']), '//fonts.googleapis.com/css?family=' . $font_family['family'] . ':' . $title['heading_family']['variant'].'' );
}
}
}
// include font family
if ( function_exists('awa_include_fonts') ) {
awa_include_fonts(
array(
'menu_item_family',
'submenu_item_family',
'gallery_font_family',
'all_button_font_family',
'all_button_font_family',
'footer_font_family',
'item_gallery_font_family',
) // all options name
);
}
}
}
function awa_regiser_info_icons() {
wp_enqueue_style( 'awa-font-info', AWA_T_URI . '/assets/css/simple-line-icons.css' );
}
add_action( 'vc_base_register_admin_css', 'awa_regiser_info_icons' );
/**
* Filter the page title.
*/
if ( ! function_exists( 'awa_wp_title' ) ) {
function awa_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() ) {
return $title;
}
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title = "$title $sep $site_description";
}
// Add a page number if necessary.
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title = "$title $sep " . sprintf( esc_html__( 'Page %s', 'awa' ), max( $paged, $page ) );
}
return $title;
}
}
add_filter( 'wp_title', 'awa_wp_title', 10, 2 );
/**
* Include plugins
**/
if ( ! function_exists( 'awa_include_required_plugins' ) ) {
function awa_include_required_plugins() {
$plugins = array(
array(
'name' => esc_html__( 'Awa Plugins', 'awa' ),
// The plugin name
'slug' => 'awa-plugins',
// The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/awa/awa-plugins.zip' ),
// The plugin source
'required' => true,
// If false, the plugin is only 'recommended' instead of required
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'version' => '1.0.1',
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Visual Composer', 'awa' ),
// The plugin name
'slug' => 'js_composer',
// The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/premium-plugins/js_composer.zip' ),
// The plugin source
'required' => true,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'The Grid', 'awa' ),
// The plugin name
'slug' => 'the_grid',
// The plugin slug (typically the folder name)
'source' => esc_url( 'http://download-plugins.viewdemo.co/premium-plugins/the_grid.zip' ),
// The plugin source
'required' => true,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Contact Form 7', 'awa' ),
// The plugin name
'slug' => 'contact-form-7',
// The plugin slug (typically the folder name)
'required' => false,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'UpQode Google Maps', 'awa' ),
// The plugin name
'slug' => 'upqode-google-maps',
// The plugin slug (typically the folder name)
'required' => false,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
array(
'name' => esc_html__( 'Woocommerce', 'awa' ),
// The plugin name
'slug' => 'woocommerce',
// The plugin slug (typically the folder name)
'required' => false,
// If false, the plugin is only 'recommended' instead of required
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '',
// If set, overrides default API URL and points to an external URL
),
);
// Change this to your theme text domain, used for internationalising strings
/**
* Array of configuration settings. Amend each line as needed.
* If you want the default strings to be available under your own theme domain,
* leave the strings uncommented.
* Some of the strings are added into a sprintf, so see the comments at the
* end of each line for what each argument will be.
*/
$config = array(
'domain' => 'awa', // Text domain - likely want to be the same as your theme.
'default_path' => '', // Default absolute path to pre-packaged plugins
'menu' => 'tgmpa-install-plugins', // Menu slug
'has_notices' => true, // Show admin notices or not
'is_automatic' => true, // Automatically activate plugins after installation or not
'message' => '', // Message to output right before the plugins table
'strings' => array(
'page_title' => esc_html__( 'Install Required Plugins', 'awa' ),
'menu_title' => esc_html__( 'Install Plugins', 'awa' ),
'installing' => esc_html__( 'Installing Plugin: %s', 'awa' ),
// %1$s = plugin name
'oops' => esc_html__( 'Something went wrong with the plugin API.', 'awa' ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'awa' ),
// %1$s = plugin name(s)
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'awa' ),
// %1$s = plugin name(s)
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'awa' ),
// %1$s = plugin name(s)
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'awa' ),
// %1$s = plugin name(s)
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'awa' ),
// %1$s = plugin name(s)
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'awa' ),
// %1$s = plugin name(s)
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'awa' ),
// %1$s = plugin name(s)
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'awa' ),
// %1$s = plugin name(s)
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'awa' ),
'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins', 'awa' ),
'return' => esc_html__( 'Return to Required Plugins Installer', 'awa' ),
'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'awa' ),
'complete' => esc_html__( 'All plugins installed and activated successfully. %s', 'awa' ),
// %1$s = dashboard link
'nag_type' => 'updated'
// Determines admin notice type - can only be 'updated' or 'error'
)
);
tgmpa( $plugins, $config );
}
}
if ( ! function_exists( 'awa_password_form' ) ) {
function awa_password_form() {
global $post;
$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
$o = '
';
return $o;
}
}
add_filter( 'the_password_form', 'awa_password_form' );
// for woocommerce
add_filter('loop_shop_columns', 'awa_loop_columns');
if (!function_exists('awa_loop_columns')) {
function awa_loop_columns() {
if (cs_get_option('products_per_row')) {
return cs_get_option('products_per_row');
} else {
return 4; // 4 products per row
}
}
}
/* For Woocommerce */
if (!function_exists('awa_add_to_cart_fragment')) {
function awa_add_to_cart_fragment( $fragments ) {
ob_start();
$count = WC()->cart->cart_contents_count;
?>
0 ) { ?>
You are running version WordPress - %s, PHP - %s.
Please upgrade need module and try again.', 'awa' ), $GLOBALS['wp_version'], PHP_VERSION );
printf( '', $message );
}
}
add_action( 'admin_notices', 'awa_requirements_notice' );
}
/*
* Check need minimal requirements (PHP and WordPress version)
*/
if ( ! function_exists( 'awa_coming_soon_notice' ) ) {
function awa_coming_soon_notice() {
if ( cs_get_option('awa_enable_coming_soon') ) {
?>