Can't get options with $data['variable'].
(I'm use SMOF - Slightly Modded Options Framework)
For example in the header.php (index.php, footer.php, etc.):
global $data;
$logo_type = stripslashes( $data['type_logo'] );
and nothing happens, variable $logo_type contains nothing.
But if I use the same code in the \css\styles.php - all works fine. Code from \css\styles.php:
<?php
/* Background Body */
$bg_color = stripslashes ( $data['ct_bg_color'] );
?>
/* Body BG Color */
body, .body-class { background-color: <?php echo $bg_color; ?>
}
Function as part of framework :
/*-----------------------------------------------------------------------------------*/
/* Generate a static css file from the defined options
/*-----------------------------------------------------------------------------------*/
// This function will generate a static css file which you can use in your theme.
// Some examples of the dynamically generated options has been defined in css/styles.php
function generate_options_css($newdata) {
$data = $newdata;
$css_dir = get_stylesheet_directory() . '/css/'; // Shorten code, save 1 call
ob_start(); // Capture all output (output buffering)
require($css_dir . 'styles.php'); // Generate CSS
$css = ob_get_clean(); // Get generated CSS (output buffering)
file_put_contents($css_dir . 'options.css', $css, LOCK_EX); // Save it
}
Link to Framework files: https://github.com/sy4mil/Options-Framework/tree/master/admin/functions
First encountered this problem... And can not understand what could be the problem (php, web hosting, etc.)
Anyone else encountered this problem?
css/styles/php. – Chip Bennett Jan 21 at 16:00<?php /* Background Body */ $bg_color = stripslashes ( $data['ct_bg_color'] ); ?> /* Body BG Color */ body, .body-class { background-color: <?php echo $bg_color; ?> }– user771417 Jan 21 at 23:32$data. – Chip Bennett Jan 21 at 23:35/css/styles.phpthat defines$data. It's in there, somewhere, in that file. – Chip Bennett Jan 21 at 23:44