File: /mnt/data/dreamsrent-wp/wp-content/themes/dreamsrent/inc/typo.php
<?php
/**
* @Set Post Views
* @return {}
*/
if (!function_exists('dreamsrent_add_dynamic_styles')) {
function dreamsrent_add_dynamic_styles() {
global $dreamsrent_theme_options;
ob_start();
?>
<?php
$breadcrumb_image = $dreamsrent_theme_options['breadcrumb_image'];
$breadcrumb_image_url = isset($breadcrumb_image) && $breadcrumb_image != '' ? $breadcrumb_image['url'] : '';
if($breadcrumb_image_url) {
?>
.breadcrumb-bar {
background-image: url("<?php echo esc_url($breadcrumb_image_url); ?>");
background-size :cover;
}
.breadcrumb-bar:before,.breadcrumb-bar:after {
display:none;
}
<?php
}
$footer_image = $dreamsrent_theme_options['footer_image_back'];
$footer_image_url = isset($footer_image) && $footer_image != '' ? $footer_image['url'] : '';
if($footer_image_url) {
?>
.footer.footer_main{
background-image: url("<?php echo esc_url($footer_image_url); ?>");
background-size :cover;
}
.footer.footer_main:after, .footer.footer_main:before {
display:none;
}
<?php
}
$bcrumb_color = !empty( $dreamsrent_theme_options['bcrumb_color'] ) ? $dreamsrent_theme_options['bcrumb_color'] : '';
$a_color = !empty( $dreamsrent_theme_options['a_color'] ) ? $dreamsrent_theme_options['a_color'] : '';
$a_color_hover = !empty( $dreamsrent_theme_options['a_color_hover'] ) ? $dreamsrent_theme_options['a_color_hover'] : '';
$theme_primary_color = !empty( $dreamsrent_theme_options['primary_color'] ) ? $dreamsrent_theme_options['primary_color'] : '';
$theme_btn_primary_back = !empty( $dreamsrent_theme_options['btn_primary_back'] ) ? $dreamsrent_theme_options['btn_primary_back'] : '';
$theme_btn_primary_color = !empty( $dreamsrent_theme_options['btn_primary_color'] ) ? $dreamsrent_theme_options['btn_primary_color'] : '';
$theme_btn_primary_hover = !empty( $dreamsrent_theme_options['btn_primary_hover'] ) ? $dreamsrent_theme_options['btn_primary_hover'] : '';
$theme_btn_secondary_back = !empty( $dreamsrent_theme_options['btn_secondary_back'] ) ? $dreamsrent_theme_options['btn_secondary_back'] : '';
$theme_btn_secondary_color = !empty( $dreamsrent_theme_options['btn_secondary_color'] ) ? $dreamsrent_theme_options['btn_secondary_color'] : '';
$theme_btn_secondary_hover = !empty( $dreamsrent_theme_options['btn_secondary_hover'] ) ? $dreamsrent_theme_options['btn_secondary_hover'] : '';
$footer_back = !empty( $dreamsrent_theme_options['footer_back'] ) ? $dreamsrent_theme_options['footer_back'] : '';
$footer_bottom_back = !empty( $dreamsrent_theme_options['footer_bottom_back'] ) ? $dreamsrent_theme_options['footer_bottom_back'] : '';
?>
<?php
if (!empty($bcrumb_color)) {
?>
:root {--dreamsrent_bcrumb_color:<?php echo esc_html( $bcrumb_color );?>;}
<?php }
if (!empty($a_color)) {
?>
:root {--dreamsrent_a_color:<?php echo esc_html( $a_color );?>;}
<?php }
if (!empty($a_color_hover)) {
?>
:root {--dreamsrent_a_color_hover:<?php echo esc_html( $a_color_hover );?>;}
<?php }
if (!empty($theme_primary_color)) {
?>
:root {--dreamsrent_primary_color:<?php echo esc_html( $theme_primary_color );?> !important;}
<?php }
if (!empty($theme_btn_primary_back)) {
?>
:root {--dreamsrent_btn_primary_back:<?php echo esc_html( $theme_btn_primary_back );?>;}
:root {--dreamsrent_btn_primary_color:<?php echo esc_html( $theme_btn_primary_color );?>;}
:root {--dreamsrent_btn_primary_hover:<?php echo esc_html( $theme_btn_primary_hover );?>;}
<?php }
if (!empty($theme_btn_secondary_back)) {
?>
:root {--dreamsrent_btn_secondary_back:<?php echo esc_html( $theme_btn_secondary_back );?>;}
:root {--dreamsrent_btn_secondary_color:<?php echo esc_html( $theme_btn_secondary_color );?>;}
:root {--dreamsrent_btn_secondary_hover:<?php echo esc_html( $theme_btn_secondary_hover );?>;}
<?php }
if (!empty($footer_back)) {
?>
:root {--dreamsrent_footer_back:<?php echo esc_html( $footer_back );?>;}
<?php }
if (!empty($footer_bottom_back)) {
?>
:root {--dreamsrent_footer_bottom_back:<?php echo esc_html( $footer_bottom_back );?>;}
<?php }
$body_typo = ! empty( $dreamsrent_theme_options['body_typography'] ) ? $dreamsrent_theme_options['body_typography'] : array();
$h1_typo = ! empty( $dreamsrent_theme_options['h1_typography'] ) ? $dreamsrent_theme_options['h1_typography'] : array();
$h2_typo = ! empty( $dreamsrent_theme_options['h2_typography'] ) ? $dreamsrent_theme_options['h2_typography'] : array();
$h3_typo = ! empty( $dreamsrent_theme_options['h3_typography'] ) ? $dreamsrent_theme_options['h3_typography'] : array();
$h4_typo = ! empty( $dreamsrent_theme_options['h4_typography'] ) ? $dreamsrent_theme_options['h4_typography'] : array();
$h5_typo = ! empty( $dreamsrent_theme_options['h5_typography'] ) ? $dreamsrent_theme_options['h5_typography'] : array();
$h6_typo = ! empty( $dreamsrent_theme_options['h6_typography'] ) ? $dreamsrent_theme_options['h6_typography'] : array();
if ( ! empty( $body_typo ) ) : ?>
body {
<?php if ( ! empty( $body_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $body_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $body_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $body_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $body_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $body_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $body_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $body_typo['color'] ); ?>;
<?php endif; ?>
}
p {
<?php if ( ! empty( $body_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $body_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $body_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $body_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $body_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $body_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $body_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $body_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php if ( ! empty( $h1_typo ) ) : ?>
h1 {
<?php if ( ! empty( $h1_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $h1_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $h1_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $h1_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h1_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $h1_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h1_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $h1_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php if ( ! empty( $h2_typo ) ) : ?>
h2 {
<?php if ( ! empty( $h2_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $h2_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $h2_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $h2_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h2_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $h2_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h2_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $h2_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php if ( ! empty( $h3_typo ) ) : ?>
h3 {
<?php if ( ! empty( $h3_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $h3_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $h3_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $h3_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h3_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $h3_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h3_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $h3_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php if ( ! empty( $h4_typo ) ) : ?>
h4 {
<?php if ( ! empty( $h4_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $h4_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $h4_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $h4_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h4_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $h4_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h4_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $h4_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php if ( ! empty( $h5_typo ) ) : ?>
h5 {
<?php if ( ! empty( $h5_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $h5_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $h5_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $h5_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h5_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $h5_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h5_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $h5_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php if ( ! empty( $h6_typo ) ) : ?>
h6 {
<?php if ( ! empty( $h6_typo['font-family'] ) ) : ?>
font-family: '<?php echo esc_attr( $h6_typo['font-family'] ); ?>';
<?php endif; ?>
<?php if ( ! empty( $h6_typo['font-size'] ) ) : ?>
font-size: <?php echo esc_attr( $h6_typo['font-size'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h6_typo['font-weight'] ) ) : ?>
font-weight: <?php echo esc_attr( $h6_typo['font-weight'] ); ?>;
<?php endif; ?>
<?php if ( ! empty( $h6_typo['color'] ) ) : ?>
color: <?php echo esc_attr( $h6_typo['color'] ); ?>;
<?php endif; ?>
}
<?php endif; ?>
<?php
return ob_get_clean();
}
}