HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpkoopkj/wp-content/themes/ohio/inc/dynamic_css/parts/subheader.php
<?php
/*
	Subheader custom style
	
	Table of contents: (use search)
	# 1. Variables
	# 2. Background color
	# 3. Typography
	# 4. Height
	# 5. View
*/

# 1. Variables
$background_color_css = '';
$background_image_css = '';
$subheader_height_css = '';
$height_css = '';

OhioOptions::get( 'page_subheader_style' ); // trigger select chain
$style_select_type = OhioOptions::get_last_select_type();

# 2. Background color
$background_type = OhioOptions::get_by_type( 'page_subheader_background_type', $style_select_type );
if ( !$background_type ) $background_type = 'color';

$background_color = OhioOptions::get_by_type( 'page_subheader_background_color', $style_select_type );

if ( $background_color ) {
	$background_color_css = 'background-color:' . $background_color . ';';
}
if ( $background_type == 'image' ) {
	$background_image_css = OhioHelper::get_background_image_css_by_type( 'page_subheader', $style_select_type );
}

# 3. Typography
$subheader_typo = OhioOptions::get_by_type( 'page_subheader_text_typo', $style_select_type );
$subheader_typo_css = OhioHelper::parse_acf_typo_to_css( $subheader_typo );

# 4. Height
$subheader_height = OhioOptions::get_by_type( 'page_subheader_height', $style_select_type );

if ( $subheader_height ) {
	$subheader_height_css  = 'height:${height}px;';
	$subheader_height_css .= 'max-height:${height}px;';
	$subheader_height_css .= 'line-height:${height}px;';

	$header_css = 'margin-top:${height}px;';

	$subheader_height_css = OhioHelper::parse_responsive_height_to_css( $subheader_height, $subheader_height_css );
	$header_css = OhioHelper::parse_responsive_height_to_css( $subheader_height, $header_css );
}

# 5. View
if ( $background_color_css || $background_image_css ) {
	$_selector = '.subheader';
	$_css = $background_color_css . $background_image_css;
	OhioBuffer::pack_dynamic_css_to_buffer( $_selector, $_css );
}

if ( $subheader_typo_css ) {
	$_selector = [
		'.subheader',
		'.subheader a'
	];
	OhioBuffer::pack_dynamic_css_to_buffer( $_selector, $subheader_typo_css );
}

if ( $subheader_height_css ) {
	$_selector = [
		'.subheader .page-container'
	];
	if ( $subheader_height_css['desktop'] ) {
		OhioBuffer::pack_dynamic_css_to_buffer( $_selector, $subheader_height_css['desktop'], 'desktop' );
	}
	// if ( $subheader_height_css['tablet'] ) {
	// 	OhioBuffer::pack_dynamic_css_to_buffer( $_selector, $subheader_height_css['tablet'], 'tablet' );
	// }
	// if ( $subheader_height_css['mobile'] ) {
	// 	OhioBuffer::pack_dynamic_css_to_buffer( $_selector, $subheader_height_css['mobile'], 'mobile' );
	// }
}