Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function seo_custom_style(){
- wp_enqueue_style('custom-style',get_template_directory_uri().'/inc/custom-style.css');
- $seo_body_font = cs_get_option('body_font');
- $seo_heading_font = cs_get_option('heading_font');
- if( array_key_exists('family', $seo_body_font) ){
- $seo_body_font_get = $seo_body_font['family'];
- }
- if( array_key_exists('family', $seo_heading_font) ){
- $seo_heading_font_get = $seo_heading_font['family'];
- }
- $custom_css = 'body{ font-family : '.$seo_body_font_get.' }
- h1, h2, h3, h4, h5, h6 {font-family: '.$seo_heading_font_get.'}
- ';
- wp_add_inline_style('custom-style',$custom_css);
- }
- add_action('wp_enqueue_scripts','seo_custom_style');
- function seo_custom_google_font_get(){
- $fonts_url = '';
- $seo_body_font = cs_get_option('body_font');
- if( array_key_exists('family', $seo_body_font) ){
- $seo_body_font_get = $seo_body_font['family'];
- }
- if ( 'off' !== _x( 'on', 'Google font: on or off', 'seo-practice' ) ) {
- $fonts_url = add_query_arg( 'family' , urlencode(''.$seo_body_font_get.':300,300i,400,400i,700,700i,900,900i&subset=latin,latin-ext'),'https://fonts.googleapis.com/css' );
- }
- return $fonts_url;
- }
- function seo_custom_header_google_font_get(){
- $fonts_url = '';
- $seo_heading_font = cs_get_option('heading_font');
- if( array_key_exists('family', $seo_heading_font) ){
- $seo_heading_font_get = $seo_heading_font['family'];
- }
- if ( 'off' !== _x( 'on', 'Google font: on or off', 'seo-practice' ) ) {
- $fonts_url = add_query_arg( 'family' , urlencode(''.$seo_heading_font_get.':300,300i,400,400i,700,700i,900,900i&subset=latin,latin-ext'),'https://fonts.googleapis.com/css' );
- }
- return $fonts_url;
- }
- function seo_gf_option(){
- wp_enqueue_style('seo-custom-google-font',seo_custom_google_font_get());
- wp_enqueue_style('seo-custom-header-google-font',seo_custom_header_google_font_get());
- }
- add_action('wp_enqueue_scripts','seo_gf_option');
Add Comment
Please, Sign In to add comment