Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $seo_body_font_get = cs_get_option('seo_body_font');
- $seo_heading_font_get = cs_get_option('seo_heading_font');
- function seo_crazycreator_body_gf_url() {
- $font_url = '';
- $seo_body_font_get = cs_get_option('seo_body_font');
- if(!empty($seo_body_font_get)) {
- $seo_body_font_get = cs_get_option('seo_body_font');
- } else {
- $seo_body_font_get = array();
- }
- if(array_key_exists('family', $seo_body_font_get)) {
- $seo_body_font_get_family = $seo_body_font_get['family'];
- } else {
- $seo_body_font_get_family = 'Titillium Web';
- }
- /*
- Translators: If there are characters in your language that are not supported
- by chosen font(s), translate this to 'off'. Do not translate into your own language.
- */
- if ( 'off' !== _x( 'on', 'Google font: on or off', 'seo-crazycreator' ) ) {
- $font_url = add_query_arg( 'family', urlencode( ''.$seo_body_font_get_family.':300,300i,400,400i,700,700i,900,900i&subset=latin,latin-ext' ), "//fonts.googleapis.com/css" );
- }
- return $font_url;
- }
- if($seo_heading_font_get['family'] == $seo_body_font_get['family']) {} else {
- function seo_crazycreator_heading_gf_url() {
- $font_url = '';
- $seo_heading_font_get = cs_get_option('seo_heading_font');
- if(!empty($seo_heading_font_get)) {
- $seo_heading_font_get = cs_get_option('seo_heading_font');
- } else {
- $seo_heading_font_get = array();
- }
- if(array_key_exists('family', $seo_heading_font_get)) {
- $seo_heading_font_get_family = $seo_heading_font_get['family'];
- } else {
- $seo_heading_font_get_family = 'Titillium Web';
- }
- /*
- Translators: If there are characters in your language that are not supported
- by chosen font(s), translate this to 'off'. Do not translate into your own language.
- */
- if ( 'off' !== _x( 'on', 'Google font: on or off', 'seo-crazycreator' ) ) {
- $font_url = add_query_arg( 'family', urlencode( ''.$seo_heading_font_get['family'].':300,300i,400,400i,700,700i,900,900i&subset=latin,latin-ext' ), "//fonts.googleapis.com/css" );
- }
- return $font_url;
- }
- }
- function seo_crazycreator_options_gf() {
- wp_enqueue_style( 'seo-crazycreator-custom-google-fonts', seo_crazycreator_body_gf_url(), array(), '1.0.0' );
- $seo_body_font_get = cs_get_option('seo_body_font');
- $seo_heading_font_get = cs_get_option('seo_heading_font');
- if($seo_heading_font_get['family'] == $seo_body_font_get['family']) {} else {
- wp_enqueue_style( 'seo-crazycreator-google-heading-fonts', seo_crazycreator_heading_gf_url(), array(), '1.0.0' );
- }
- }
- add_action( 'wp_enqueue_scripts', 'seo_crazycreator_options_gf' );
- if ( ! function_exists( 'seo_crazycrator_color_theme' ) ) :
- function seo_crazycrator_color_theme() {
- $seo_body_font = cs_get_option('seo_body_font');
- $seo_body_font_weight = cs_get_option('seo_body_font_variant');
- wp_enqueue_style(
- 'seo-custom-style', get_template_directory_uri() . '/assets/css/custom-style.css'
- );
- $custom_css = '';
- if(!empty($seo_body_font)) {
- $seo_body_font = cs_get_option('seo_body_font');
- } else {
- $seo_body_font = array();
- }
- if(array_key_exists('family', $seo_body_font)) {
- $seo_body_font_family = $seo_body_font['family'];
- } else {
- $seo_body_font_family = '';
- }
- if(!empty($seo_body_font_family)){
- $custom_css .= '
- body{
- font-family: '.$seo_body_font_family.';
- }
- ';
- }
- wp_add_inline_style( 'seo-custom-style', $custom_css );
- }
- add_action( 'wp_enqueue_scripts', 'seo_crazycrator_color_theme' );
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement