$link) {
$html .= sprintf(' %3$s ',
esc_attr($key),
esc_url($link),
wp_kses_post($lables[$key])
);
}
$html = '';
return $html;
}
}
function amazica_get_page_labels() {
$lables = array(
'myaccount' => ' ' . esc_html__('My Account', 'amazica'),
'login' => ' ' . esc_html__('Login', 'amazica'),
'register' => ' ' . esc_html__('Register', 'amazica'),
'cart' => ' ' . esc_html__('Cart', 'amazica'),
'checkout' => ' ' . esc_html__('Checkout', 'amazica'),
'wishlist' => ' ' . esc_html__('Wishlist', 'amazica'),
'logout' => ' ' . esc_html__('Logout', 'amazica'),
);
$lables = apply_filters('amazica_page_labels', $lables);
return $lables;
}
function amazica_excerpt_more($more) {
if (is_admin()) {
return $more;
}
return '...';
}
add_filter('excerpt_more', 'amazica_excerpt_more');
function amazica_excerpt_length( $length ) {
if (is_admin()) {
return $length;
}
return 20;
}
add_filter( 'excerpt_length', 'amazica_excerpt_length', 999 );
function amazica_comment_form_fields($fields) {
$fields['author'] = '';
$fields['email'] = '';
$fields['url'] = '';
return $fields;
}
add_filter('comment_form_fields', 'amazica_comment_form_fields');
function amazica_comment_form_defaults($defaults){
$defaults['submit_field'] = '%1$s %2$s
';
$defaults['comment_field'] = '';
$defaults['title_reply_to'] = esc_html__('Post Your Reply Here To %s', 'amazica');
$defaults['class_submit'] = 'btn btn-theme';
$defaults['label_submit'] = esc_html__('SUBMIT COMMENT', 'amazica');
$defaults['title_reply'] = '';
$defaults['role_form'] = 'form';
return $defaults;
}
add_filter('comment_form_defaults', 'amazica_comment_form_defaults');
function amazica_comment($comment, $args, $depth) {
// get theme data.
global $comment_data;
// translations.
$leave_reply = $comment_data['translation_reply_to_coment'] ? $comment_data['translation_reply_to_coment'] : __('Reply', 'amazica');?>
$weights) {
if (in_array($font, $google_fonts)) {
if (!empty($weights)) {
$font_families[] = $font . ':' . implode(',', $weights);
} else {
$font_families[] = $font;
}
}
}
} else {
return;
}
if (!empty($font_families)) {
$query_args = array(
'family' => urlencode(implode('|', $font_families)),
);
$fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css');
return esc_url_raw($fonts_url);
}
return;
}
function amazica_add_custom_styles() {
$style = '';
$default_body_font = apply_filters('amazica_default_body_font', 'Lato');
$body_font_family = get_theme_mod('amazica_body_font_family', $default_body_font);
$body_font_family = !empty($body_font_family) ? $body_font_family : 'Lato';
$body_font_size = get_theme_mod('themefarmer_body_font_size', 10);
if (is_array($body_font_size)) {
$desk_fs = $body_font_size['desktop'] + 4;
$tabl_fs = $body_font_size['tablet'];
$mobl_fs = $body_font_size['mobile'];
} else {
$desk_fs = $body_font_size + 4;
}
$style .= "
body{
font-family:'{$body_font_family}', sans-serif;
font-size:{$desk_fs}px !important;
}
";
$style = apply_filters('amazica_inline_style', $style);
wp_add_inline_style('amazica-style', $style);
}
add_action('wp_enqueue_scripts', 'amazica_add_custom_styles', 31);
function amazica_blog_layout() {
if (is_page_template()) {
return;
}
if (is_page()) {
$layout = get_theme_mod('amazica_blog_single_page_layout', 'full');
} elseif (is_single()) {
$layout = get_theme_mod('amazica_blog_single_post_layout', 'right');
} else {
$layout = get_theme_mod('amazica_blog_post_index_layout', 'right');
}
return amazica_get_layout_class($layout);
}
function amazica_woocommerce_layout(){
$layout = 'left';
if(amazica_is_wc()){
if(is_shop()){
$layout = get_theme_mod('amazica_wc_shop_page_layout', 'left');
} elseif(is_product()){
$layout = get_theme_mod('amazica_wc_product_single_layout', 'full');
}
}
return amazica_get_layout_class($layout);
}
function amazica_get_layout_class($layout = 'right') {
$class = 'col-md-9';
switch ($layout) {
case 'right':
$class = 'col-md-9';
break;
case 'left':
$class = 'col-md-9 order-last';
break;
case 'full':
$class = 'col-md-12';
break;
default:
$class = 'col-md-9';
break;
}
return $class;
}
function amazica_home_sections_init() {
$default_sections = apply_filters('amazica_home_page_default_sections', array('slider', 'services', 'about', 'callout', 'products-latest', 'team', 'testimonials', 'brands', 'subscribe', 'blog', 'contact'));
$home_sections = get_theme_mod('amazica_home_layout', $default_sections);
$home_sections = apply_filters('amazica_home_page_sections', $home_sections);
$priority = 30;
foreach ($home_sections as $key => $section) {
$section_name = str_replace('-', '_', $section);
$section_name = str_replace(' ', '_', $section_name);
if(get_theme_mod('amazica_is_enable_section_'.$section_name, true )){
if (function_exists('amazica_homepage_section_' . $section_name)) {
add_action('amazica_print_home_page_sections', 'amazica_homepage_section_' . $section_name, $priority);
}
elseif (function_exists('themefarmer_homepage_section_' . $section_name)) {
add_action('amazica_print_home_page_sections', 'themefarmer_homepage_section_' . $section_name, $priority);
}
}
$priority += 10;
}
}
add_action('amazica_befor_print_home_page_sections', 'amazica_home_sections_init', 30);
function amazica_homepage_section_products_latest() {
get_template_part('template-parts/home', 'products-latest');
}
function amazica_homepage_section_callout(){
get_template_part('template-parts/home', 'callout');
}
function amazica_homepage_section_subscribe(){
get_template_part('template-parts/home', 'subscribe');
}
function amazica_homepage_section_blog() {
get_template_part('template-parts/home', 'blog');
}
function amazica_homepage_section_about() {
get_template_part('template-parts/home', 'about');
}
function amazica_homepage_section_slider(){
get_template_part('template-parts/home', 'slider');
}
function amazica_homepage_section_services(){
get_template_part('template-parts/home', 'services');
}
function amazica_homepage_section_testimonials(){
get_template_part('template-parts/home', 'testimonials');
}
function amazica_homepage_section_team(){
get_template_part('template-parts/home', 'team');
}
function amazica_set_theme_primary_color($custom_css){
$primary_color = get_theme_mod('amazica_theme_primary_color');
if($primary_color == '#0186f0'){
return;
}
if(!empty($primary_color)){
$custom_css.= "
a,
a:hover,
a:focus {
color: {$primary_color};
}
a,
a:hover,
a:focus {
color: {$primary_color};
}
.header-topbar-links li a,
span.contact-link > a > i {
background-color: {$primary_color};
}
.section-title:before {
border-bottom: 3px solid {$primary_color};
}
.btn-theme-border {
border: 1px solid {$primary_color};
}
button,
input[type='button'],
input[type='reset'],
input[type='submit'] {
background-color: {$primary_color};
}
.widget ul li:hover a,
.widget ul li:hover:before {
color: {$primary_color};
}
.tagcloud a {
border: 1px solid {$primary_color};
background-color: {$primary_color};
}
.calendar_wrap caption {
background-color: {$primary_color};
}
.widget-heading:before {
border-bottom: 1px solid {$primary_color};
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
border-color: {$primary_color};
color: {$primary_color};
}
.sweep-to-left:before {
background: {$primary_color};
}
.sweep-to-right:before {
background: {$primary_color};
}
.sweep-to-bottom:before {
background: {$primary_color};
}
.sweep-to-top:before {
background: {$primary_color};
}
.fill-to-top:before {
background-color: {$primary_color};
}
.home-section .owl-next,
.home-section .owl-prev {
background-color: {$primary_color};
}
.slider-heading {
border-left: 6px solid {$primary_color}e0;
border-right: 6px solid {$primary_color}e0;
border-top: 6px solid {$primary_color}e0;
}
.slider-desc {
background-color: {$primary_color}e0;
}
.home-slider .owl-prev,
.home-slider .owl-next {
background-color: {$primary_color}6e;
border-color: {$primary_color};
}
.slide-bt-2:hover {
border-color: {$primary_color};
}
.service-item-inner {
border-bottom: 2px solid {$primary_color};
}
.service-icon {
border: 1px solid {$primary_color};
color: {$primary_color};
}
.service-title {
color: {$primary_color};
}
.service-icon:before {
background-color: {$primary_color};
}
.meamber-info {
background-color: {$primary_color}c2;
}
.member-designation {
background-color: {$primary_color};
}
.testimonial-item-inner:hover .testimonial-img {
border-color: {$primary_color};
}
.section-subscribe {
background-color: {$primary_color};
}
.home-post-inner {
border-bottom: 4px solid {$primary_color};
}
.post-qk-link:hover {
border-color: {$primary_color};
}
.blog-avtar {
border: 1px solid {$primary_color};
}
.sticky.post .content-index-inner {
border-color: {$primary_color};
}
.sticky.post .content-index-inner .row.post-index-bottom {
background-color: {$primary_color};
}
.amz-singuler .post-navigation .nav-links a {
border: 1px solid {$primary_color};
}
.amz-singuler .post-navigation .nav-links a:hover {
background-color: {$primary_color};
}
#scroll-top {
background-color: {$primary_color}9c;
border: 1px solid {$primary_color};
}
.button {
background-color: {$primary_color};
}
.btn-read-more {
font-size: 14px;
border: 1px solid {$primary_color};
}
.calendar_wrap tfoot td:hover,
.calendar_wrap tfoot td:hover a,
.calendar_wrap tbody td:hover {
color: {$primary_color};
}
.calendar_wrap td a:hover {
color: {$primary_color};
}
#TF-Navbar > ul >li>a:before, .sticky-head #TF-Navbar > ul >li>a:before {
background-color: {$primary_color} !important;
}
.dropdown-item:focus,
.dropdown-item:hover,
.dropdown-item:active {
color: {$primary_color};
}
@media (min-width: 768px) {
#TF-Navbar > ul .dropdown-menu {
background-color: {$primary_color}de !important;
}
#TF-Navbar > ul .dropdown-menu > li:hover {
background-color: {$primary_color} !important;
}
}
span.onsale {
background-color: {$primary_color};
}
.widget_price_filter .ui-slider .ui-slider-range {
background: {$primary_color};
}
.widget_price_filter .ui-slider .ui-slider-handle {
background: {$primary_color};
}
.woocommerce-error, .woocommerce-info, .woocommerce-message {
border-top: 3px solid {$primary_color};
}";
}
return $custom_css;
}
add_filter('amazica_inline_style', 'amazica_set_theme_primary_color', 30);
$leave_reply, 'depth' => $depth, 'max_depth' => $args['max_depth'])))?> comment_approved == '0'): ?>