<?php
/* This file outputs custom css that was enterred in theme
   options page.
---------------------------------------------------------- */

/* Fire up WordPress stuff */
$absolute_path = __FILE__;
$path_to_file = explode( 'wp-content', $absolute_path );
$path_to_wp = $path_to_file[0];

//Access WordPress
require_once( $path_to_wp . '/wp-load.php' );

header("Content-type: text/css");


$customcss = get_option('wpb_customcss');
$custombg = get_option('wpb_background');
$bgcolor = get_option('wpb_body_color');

if ( $bgcolor != '' ) :
?>
body {
	background-color: <?php echo $bgcolor; ?>;
}
<?php
endif;

if ( $custombg ):
	switch ( $bg_pos = get_option('wpb_background_position') ) {
		case __('Center the image at the top of the page', 'wpb_framework'):
			$repeat = " top center no-repeat";
		break;
		
		case __('Repeat horizontally across the top', 'wpb_framework'):
			$repeat = " top repeat-x";
		break;
		
		case __('Repeat vertically down the left side', 'wpb_framework'):
			$repeat = " top left repeat-y";
		break;
		
		case __('Repeat vertically down the right side', 'wpb_framework'):
			$repeat = " top right repeat-y";
		break;
		
		default: $repeat = '';
	}
	?>
body {
	background: <?php echo $bgcolor; ?> url(<?php echo $custombg; ?>)<?php echo $repeat; ?>;
}
<?php endif; ?>

<?php
if (function_exists('wpb_custom_accent_colors')) { wpb_custom_accent_colors(); }

// echo CSS from custom css field
echo stripslashes($customcss);
?>