HEX
Server: Apache
System: Linux webserver101.turnkeywebspace.com 4.18.0-553.81.1.el8_10.x86_64 #1 SMP Mon Oct 27 11:29:19 EDT 2025 x86_64
User: mastech10 (1521)
PHP: 8.2.30
Disabled: show_source,system,shell_exec,passthru,exec,phpinfo,popen,proc_open,eval
Upload Files
File: /home/mastech10/www/global-trade-news.com/wp-content/themes/visionary-news/inc/dynamic-css.php
<?php

/**
 * Dynamic CSS
 */
function visionary_news_dynamic_css() {

	$site_title_font       = get_theme_mod( 'visionary_news_site_title_font', 'Hind' );
	$site_description_font = get_theme_mod( 'visionary_news_site_description_font', 'Roboto' );
	$header_font           = get_theme_mod( 'visionary_news_header_font', 'Exo' );
	$body_font             = get_theme_mod( 'visionary_news_body_font', 'Roboto' );

	$custom_css  = '';
	$custom_css .= '
	/* Color */
	:root {
		--site-title-color: ' . esc_attr( '#' . get_header_textcolor() ) . ';
		--custom-bg-clr: ' . esc_attr( '#' . get_background_color() ) . ';
	}
	';

	$custom_css .= '
	/* Typograhpy */
	:root {
		--site-title-font: "' . esc_attr( $site_title_font ) . '", serif;
		--site-description-font: "' . esc_attr( $site_description_font ) . '", serif;
		--font-heading: "' . esc_attr( $header_font ) . '", serif;
		--font-body: "' . esc_attr( $body_font ) . '", serif;
	}';

	wp_add_inline_style( 'visionary-news-style', $custom_css );

}

add_action( 'wp_enqueue_scripts', 'visionary_news_dynamic_css', 99 );