'primary_menu',
'container' => '',
'menu_class' => 'menu-wrap menu-primary',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker()
)
);
}
}
add_action( 'aromatic_main_nav', 'aromatic_main_nav' );
/**
* Aromatic Header Cart
*/
if ( ! function_exists( 'aromatic_hdr_cart' ) ) {
function aromatic_hdr_cart() {
$aromatic_hs_cart = get_theme_mod( 'hide_show_cart','1');
if($aromatic_hs_cart=='1' && class_exists( 'woocommerce' )): ?>
cart->get_cart_subtotal(); ?>
'product_cat',
'hide_empty' => false,
'parent' => 0
);
$product_cat = get_terms( $categories );
foreach ($product_cat as $parent_product_cat) {
$child_args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => $parent_product_cat->term_id
);
$thumbnail_id = get_term_meta( $parent_product_cat->term_id, 'thumbnail_id', true );
$image = wp_get_attachment_url( $thumbnail_id );
$child_product_cats = get_terms( $child_args );
$aromatic_product_cat_icon = get_term_meta($parent_product_cat->term_id, 'aromatic_product_cat_icon', true);
if ( ! empty($child_product_cats) ) {
echo '';
} ?>
cart->cart_contents_count;
?>
0 ) {
?>
cart->get_cart_subtotal(); ?>
__( 'Header Widget Area', 'aromatic' ),
'id' => 'aromatic-header-above-widget',
'before_widget' => ''
) );
register_sidebar( array(
'name' => __( 'Sidebar Widget Area', 'aromatic' ),
'id' => 'aromatic-sidebar-primary',
'description' => __( 'The Primary Widget Area', 'aromatic' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer Widget', 'aromatic' ),
'id' => 'aromatic-footer-widget',
'description' => __( 'Footer Widget', 'aromatic' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'WooCommerce Widget Area', 'aromatic' ),
'id' => 'aromatic-woocommerce-sidebar',
'description' => __( 'This Widget area for WooCommerce Widget', 'aromatic' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'aromatic_widgets_init' );
/**
* This Function Check whether Sidebar active or Not
*/
if(!function_exists( 'aromatic_blog_column_layout' )) :
function aromatic_blog_column_layout(){
if(is_active_sidebar('aromatic-sidebar-primary'))
{ echo 'col-lg-8'; }
else
{ echo 'col-lg-12'; }
} endif;
function aromatic_breadcrumbs_list() {
$showOnHome = esc_html__('1','aromatic'); // 1 - Show breadcrumbs on the homepage, 0 - don't show
$delimiter = ''; // Delimiter between breadcrumb
$home = esc_html__('Home','aromatic'); // Text for the 'Home' link
$showCurrent= esc_html__('1','aromatic'); // Current post/page title in breadcrumb in use 1, Use 0 for don't show
$before = ''; // Tag before the current Breadcrumb
$after = ' '; // Tag after the current Breadcrumb
$breadcrumb_middle_content = '>';
global $post;
$homeLink = home_url();
if (is_home() || is_front_page()) {
if ($showOnHome == 1) echo ' ' . esc_html($home) . ' ';
} else {
echo ' ' . esc_html($home) . ' ' . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ';
if ( is_category() )
{
$thisCat = get_category(get_query_var('cat'), false);
if ($thisCat->parent != 0) echo get_category_parents($thisCat->parent, TRUE, ' ' . ' ');
echo $before . esc_html__('Archive by category','aromatic').' "' . esc_html(single_cat_title('', false)) . '"' .$after;
}
elseif ( is_search() )
{
echo $before . esc_html__('Search results for ','aromatic').' "' . esc_html(get_search_query()) . '"' . $after;
}
elseif ( is_day() )
{
echo '' . esc_html(get_the_time('Y')) . ' ' . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ';
echo '' . esc_html(get_the_time('F')) . ' '. ' ' . wp_kses_post($breadcrumb_middle_content) . ' ';
echo $before . esc_html(get_the_time('d')) . $after;
}
elseif ( is_month() )
{
echo '' . esc_html(get_the_time('Y')) . ' ' . esc_attr($delimiter) . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ';
echo $before . esc_html(get_the_time('F')) . $after;
}
elseif ( is_year() )
{
echo $before . esc_html(get_the_time('Y')) . $after;
}
elseif ( is_single() && !is_attachment() )
{
if ( get_post_type() != 'post' )
{
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo ' ' . $post_type->labels->singular_name . ' ';
if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ' . $before . wp_kses_post(get_the_title()) . $after;
}
else
{
$cat = get_the_category(); $cat = $cat[0];
$cats = get_category_parents($cat, TRUE, ' ' . esc_attr($delimiter) . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ');
if ($showCurrent == 0) $cats = preg_replace("#^(.+)\s$delimiter\s$#", "$1", $cats);
echo $cats;
if ($showCurrent == 1) echo $before . esc_html(get_the_title()) . $after;
}
}
elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
if ( class_exists( 'WooCommerce' ) ) {
if ( is_shop() ) {
$thisshop = woocommerce_page_title();
}
}
else {
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
}
}
elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() )
{
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
}
elseif ( is_attachment() )
{
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID);
if(!empty($cat)){
$cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . esc_attr($delimiter) . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ');
}
echo '' . $parent->post_title . ' ';
if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . $before . esc_html(get_the_title()) . $after;
}
elseif ( is_page() && !$post->post_parent )
{
if ($showCurrent == 1) echo $before . esc_html(get_the_title()) . $after;
}
elseif ( is_page() && $post->post_parent )
{
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id)
{
$page = get_page($parent_id);
$breadcrumbs[] = '' . esc_html(get_the_title($page->ID)) . ' ' . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
for ($i = 0; $i < count($breadcrumbs); $i++)
{
echo $breadcrumbs[$i];
if ($i != count($breadcrumbs)-1) echo ' ' . esc_attr($delimiter) . ' ' . wp_kses_post($breadcrumb_middle_content) . ' ';
}
if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . $before . esc_html(get_the_title()) . $after;
}
elseif ( is_tag() )
{
echo $before . esc_html__('Posts tagged ','aromatic').' "' . esc_html(single_tag_title('', false)) . '"' . $after;
}
elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $before . esc_html__('Articles posted by ','aromatic').'' . $userdata->display_name . $after;
}
elseif ( is_404() ) {
echo $before . esc_html__('Error 404 ','aromatic'). $after;
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo '';
echo ' ( ' . esc_html__('Page','aromatic') . '' . esc_html(get_query_var('paged')). ' )';
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo '';
}
echo ' ';
}
}
/**
* Aromatic Theme Icons
*/
if(!function_exists( 'aromatic_theme_icon' )) :
function aromatic_theme_icon($icon) {
if (str_contains($icon, 'ja')) {
return 'jcs'.' '.$icon;
}else{
return 'fa'.' '.$icon;
}
}
endif;