<style>
  body {
    /* Custom Typography */
    <?php
      $custom_typography = yp_opts('fonts_typography_body');

      if($custom_typography['font-family']) {
        echo 'font-family: ' . $custom_typography['font-family'] . ', sans-serif;';
      }
      if($custom_typography['font-size']) {
        echo 'font-size: ' . $custom_typography['font-size'] . ';';
      }
      if($custom_typography['letter-spacing']) {
        echo 'letter-spacing: ' . $custom_typography['letter-spacing'] . ';';
      }
      if($custom_typography['line-height']) {
        echo 'line-height: ' . $custom_typography['line-height'] . ';';
      }
    ?>
    
    /* Custom Background */
    <?php
      $background = yp_opts('general_background', true);
      if($background) {
        $url = yp_opts('general_background_image', true);
        $cover = yp_opts('general_background_cover', true);
        $fixed = yp_opts('general_background_fixed', true);

        if($url) {
          echo 'background-image: url(' . $url . ');';
        }
        if($cover) {
          echo 'background-size: cover;';
        }
        if($fixed) {
          echo 'background-attachment: fixed;';
        }
      }
    ?>
  }
  .content-wrap {
    /* Content background image with opacity */
    <?php
    if($background) {
      // content background color
      $theme_style = yp_opts('theme_style');
      $cont_color = '#080325';
      $opacity = yp_opts('general_content_bg_opacity', yp_opts('general_content_bg_opacity_metabox', true)) / 100;

      if($theme_style == 'light') {
        $cont_color = '#ffffff';
      } else if($theme_style == 'custom') {
        $cont_color = yp_opts('theme_back_color');
      }

      $rgb = hex2rgb($cont_color);

      echo 'background: rgba(' . $rgb[0] . ',' . $rgb[1] . ',' . $rgb[2] . ',' . $opacity . ');';
    }
    ?>
  }
</style>