id, array( 'widgets' ) ) ){
wp_enqueue_script('admin-custom-script-js', FIXIT_FRAMEWORK_DIR . '/js/script.js', array('jquery'), true );
wp_enqueue_script('fixit-widget', get_template_directory_uri() . '/inc/widget/assets/widget.js', array('jquery'), true );
}
}
add_action( 'admin_footer', 'mh_admin_scripts' );
}
/**
* Admin Stylesheet.
*/
if( ! function_exists( 'mh_admin_styles' ) ){
function mh_admin_styles(){
wp_enqueue_style( 'thickbox' );
Fixit_Factory::fixit_enqueue( 'style', 'color-picker' );
Fixit_Factory::fixit_enqueue( 'style', 'date-picker' );
Fixit_Factory::fixit_enqueue( 'style', 'fontawesome' );
Fixit_Factory::fixit_enqueue( 'style', 'fontello' );
}
add_action( 'admin_head', 'mh_admin_styles' );
}
/**
* Customization JQuery Include.
*/
if( !function_exists( 'fixit_function_Customization_Control_js' ) ){
function fixit_function_Customization_Control_js(){
if( mh_get_option('google_map_api_key') != '' )
wp_enqueue_script( "fixit-google-map",
esc_url( "https://maps.googleapis.com/maps/api/js?key=". esc_attr( mh_get_option('google_map_api_key') ) ."" ),
array( 'customize-controls', 'jquery' ), '20160412', true );
wp_enqueue_script('admin-custom-script-js', FIXIT_FRAMEWORK_DIR . '/js/script.js', array( 'customize-controls', 'fixit-google-map', 'jquery' ), '20160412', true );
}add_action( 'customize_controls_enqueue_scripts', 'fixit_function_Customization_Control_js' );
}
if( ! function_exists( 'fixit_function_google_fonts_link' ) ){
function fixit_function_google_fonts_link(){
$style = '';
$google_font = esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'body-font-family') );
if( $google_font != '') :
$style .= '';
else :
$style .= '';
endif;
print $style;
} add_action( 'wp_head', 'fixit_function_google_fonts_link' );
}
if( !function_exists( 'fixit_new_style' ) ) {
function fixit_new_style(){
$check = $class = $class_1 = $class_2 = $css_map = $css_map_1 = $css_map_2 = '';
$mh_options = mh_theme_options();
foreach ( $mh_options as $value ) :
switch( $value['type'] ) :
case "color" :
$id = $value['id'];
foreach ($value['customizer'] as $key => $value) { $class = $key; $css_map = $value; }
if( mh_get_option( $id ) != '' ) $check .= $class .'{'. $css_map .':'. mh_get_option( $id ) .';}';
break;
case "color_2" :
$id_1 = $value['id_1'];
foreach ($value['customizer_1'] as $key_1 => $value_1) { $class_1 = $key_1; $css_map_1 = $value_1; }
if( mh_get_option( $id_1 ) != '' ) $check .= $class_1 .'{'. $css_map_1 .':'. mh_get_option( $id_1 ) .';}';
$id_2 = $value['id_2'];
foreach ($value['customizer_2'] as $key_2 => $value_2) { $class_2 = $key_2; $css_map_2 = $value_2; }
if( mh_get_option( $id_2 ) != '' ) $check .= $class_2 .'{'. $css_map_2 .':'. mh_get_option( $id_2 ) .';}';
break;
case "typography" :
$id = $value['id_4'];
foreach ($value['customizer_4'] as $key => $value) { $class = $key; $css_map = $value; }
if( mh_get_option( $id ) != '' ) $check .= $class .'{'. $css_map .':'. mh_get_option( $id ) .';}';
break;
endswitch;
endforeach;
$style = "";
/**
* Style Setting
*/
$style .= $check;
/**
* Font h1, h2, h3, h4, h5, h6 TYPOGRAPHY
*/
$html_tag = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p');
foreach( $html_tag as $tag ){
$font_style = 'font-size : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'font-size-'. $tag ) ) .'px;';
$line_height = 'line-height : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'line-height-'. $tag ) ) .'px;';
$font_weight = 'font-weight : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'font-weight-'. $tag ) ) .';';
$style .= $tag . '{'. $font_style . $line_height . $font_weight .'}';
}
/** Logo Margin **/
$style .= '.header_img_logo {
margin-left : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'logo_ml' ) ) .'px;
margin-top : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'logo_mt' ) ) .'px;
margin-right : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'logo_mr' ) ) .'px;
margin-bottom : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'logo_mb' ) ) .'px;
}';
$style .= 'body{
background-image : url('. esc_url( mh_get_option( Fixit_Factory::fixit_prefix().'background_image') ) .');
font-style : ' . esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'body-font-style') ) .';
font-family: ' . esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'body-font-family') ) .';
line-height: ' . esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'body-line-height') ) .'px;
font-size: ' . esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'body-font-size') ) .'px;
}';
/**
* Page Banner H1 Color.
*/
$style .= '.page-header h1.page-title {
font-size : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'page-banner-font-size') ) .'px;
line-height : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'page-banner-line-height') ) .'px;
font-weight : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'page-banner-font-weight') ).';
}';
/**
* Slider Options.
*/
$style .= '.slider-title {
font-family : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_heading_font_family') ) .';
font-weight : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_heading_font_weight') ) .';
font-size : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_heading_font_size') ) .'px;
line-height : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_heading_line_height') ) .'px;
}';
$style .= '.slider-text {
font-family : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_description_font_family') ) .';
font-weight : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_description_font_weight') ) .';
font-size : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_description_font_size') ) .'px;
line-height : '. esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'slider_description_line_height') ) .'px;
}';
/** @media css **/
$style .= '@media only screen and (max-width: 768px){
.slider-title { font-size: 26px;line-height: 29px; }
.slider-captions {bottom: 20%;width: 75%;text-align: center;left: 10%;position: absolute;}
}';
$style .= esc_attr( mh_get_option( Fixit_Factory::fixit_prefix().'custome_css') );
wp_enqueue_style( 'fixit-custom-style', get_template_directory_uri() . Fixit_Factory::fixit_directory( 'assets' ) . '/css/custom-style.css' );
wp_add_inline_style( 'fixit-custom-style', preg_replace('/\s+/', ' ', $style ) );
} add_action( 'wp_enqueue_scripts', 'fixit_new_style', absint('9999') );
}
/**
* Front Page and Front-page.php slider jquery.
*/
if( !function_exists( 'fixit_slider_script' )){
function fixit_slider_script(){
if( is_page_template('template/front-page.php') || is_front_page() ):
wp_enqueue_script( 'fixit-script', get_template_directory_uri(). Fixit_Factory::fixit_directory( 'assets' ). 'js/script.js', array('jquery'), Fixit_Factory::fixit_details('fixit_version'), true );
$rtl_checker = ( is_rtl() ) ? esc_js('true') : esc_js('false');
$slide_show = esc_js( absint("1") );
$auto_play = esc_js( "true" );
$arrows = ( mh_get_option('nav') ) ? esc_js( "true" ) : esc_js( "false" );
$dots = ( mh_get_option('dots') ) ? esc_js( "true" ) : esc_js( "false" );
$speed = ( mh_get_option('animatespeed') ) ? esc_js( absint( mh_get_option('animatespeed') ) ) : esc_js( absint("10000") );
wp_add_inline_script( 'fixit-script', "
jQuery(document).ready(function(){
if( jQuery('.slider').length ){
jQuery('.slider').slick({
rtl: ".$rtl_checker.",
slidesToShow: ".$slide_show.",
autoplay: ".$auto_play.",
arrows: ".$arrows.",
dots: ".$dots.",
autoplaySpeed: ".$speed.",
});
}
});"
);
endif;
}add_action( 'wp_enqueue_scripts', 'fixit_slider_script', absint('9999') );
}
?>