get('Version')
);
wp_enqueue_style('icare-css-plugin-collections', get_stylesheet_directory_uri() . "/assets/css/icarefitness-css-plugin-collections.css");
wp_enqueue_style('icare-theme-skin-sky-blue', get_stylesheet_directory_uri() . "/assets/css/colors/theme-skin-coral-red.css");
}
add_action( 'wp_enqueue_scripts', 'icarefitness_enqueue_styles');
/**
* Filter the "read more" excerpt string link to the post.
*
* @param string $more "Read more" excerpt string.
* @return string (Maybe) modified "read more" excerpt string.
*/
function icarefitness_excerpt_more($more)
{
return sprintf('
%2$s',
get_permalink(get_the_ID()),
esc_html__('Read More', 'icarefitness')
);
}
add_filter('excerpt_more', 'icarefitness_excerpt_more', 15);
add_filter("the_excerpt", "icarefitness_break_text");
function icarefitness_break_text($text){
$length = 100;
if(strlen($text)<$length+10) return $text;//don't cut if too short
$break_pos = strpos($text, ' ', $length);//find next space after desired length
$visible = substr($text, 0, $break_pos);
return balanceTags($visible) . "...";
}
add_action( 'customize_register', 'icarefitness_customizer', 20 );
function icarefitness_customizer( $wp_customize ) {
$parent_theme = wp_get_theme( 'icare', '');
// Overwriting parent documentation link
if( $parent_theme['Version'] > '1.3.1' ){
$wp_customize->get_section('button')->pro_url = esc_url( 'https://www.webhuntinfotech.com/icare-fitness-theme-documentation/', 'icarefitness' );
}
// Removing Parent option
$wp_customize->remove_control('icare_menu_bg_color');
$wp_customize->add_setting(
'icarefitness_hero_btn',
array(
'type' => 'theme_mod',
'sanitize_callback' => 'icare_sanitize_text',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control('icarefitness_hero_btn',array(
'label' => esc_html__('Button Text','icarefitness'),
'section' => 'slider',
'settings' => 'icarefitness_hero_btn',
'type' => 'text',
'priority' => 11,
)
);
$wp_customize->add_setting(
'icarefitness_hero_btn_url',
array(
'type' => 'theme_mod',
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control('icarefitness_hero_btn_url',array(
'label' => esc_html__('Button Url','icarefitness'),
'section' => 'slider',
'settings' => 'icarefitness_hero_btn_url',
'type' => 'url',
'priority' => 11,
)
);
$wp_customize->add_setting(
'icarefitness_cta_desc',
array(
'type' => 'theme_mod',
'sanitize_callback' => 'icare_sanitize_text',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control('icarefitness_cta_desc',array(
'label' => esc_html__('Description','icarefitness'),
'section' => 'calltoaction',
'settings' => 'icarefitness_cta_desc',
'type' => 'textarea',
'priority' => 11,
)
);
$wp_customize->add_setting(
'icarefitness_cta_image',
array(
'type' => 'theme_mod',
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'icarefitness_cta_image',
array(
'label' => esc_html__('Image','icarefitness'),
'description' => esc_html__('Recommended Image Size: 300x300px', 'icarefitness'),
'section' => 'calltoaction',
'settings' => 'icarefitness_cta_image',
'priority' => 11
)
)
);
}
add_filter('icare_setting_default_values','icarefitness_setting_default_values', 10, 1);
function icarefitness_setting_default_values($args){
$args['icarefitness_hero_btn'] = esc_html("Lorem Ipsum");
$args['icarefitness_hero_btn_url'] = esc_url(get_home_url());
$args['icarefitness_cta_desc'] = esc_html("Curabitur sed iaculis dolor, non congue ligula. Maecenas imperdiet ante eget hendrerit posuere.");
$args['icarefitness_cta_image'] = esc_url(get_stylesheet_directory_uri() . '/assets/images/icarefitness-cta-img.jpg');
/* Reset Default Settings */
$args['icare_topbar_bg_color'] = '#000';
$args['icare_hero_image'] = esc_url(get_stylesheet_directory_uri() . '/assets/images/icarefitness-hero-img.jpg');
$args['icare_cta_bg_color'] = '#ff3547';
$args['icare_breadcrumbs_bg_image'] = esc_url(get_stylesheet_directory_uri() . '/assets/images/icarefitness-Breadcrumb-img.jpg');
$args['icare_footer_link_color'] = '#ff3547';
$args['icare_menu_color_hover'] = '#ff3547';
$args['icare_breadcrumbs_font_color'] = '#ffffff';
$args['header_textcolor'] = '000000';
$args['icare_header_background_color'] = '#ffffff';
$args['icare_br_s_p_t'] = '60';
$args['icare_br_s_p_b'] = '60';
return $args;
}
function icarefitness_theme_setup()
{
load_child_theme_textdomain('icarefitness', get_template_directory() . '/lang');
}
add_action('after_setup_theme', 'icarefitness_theme_setup', 20);