使用$ data ['variable']无法获得选项

Can't get options with $data['variable'].

(I'm using 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.

First encountered this problem... And can not understand what could be the problem (php, web hosting, etc.)

Anyone else encountered this problem?

You mention that this is not working in the header.php file. This could be caused by the variable $data not being declared before the header.php file is invoked.

Have you checked that $data has been defined prior to trying to access data from that variable?

Make sure you add this code in header.php before add your current code

global $data;
global $smof_data;

$logo_type = stripslashes( $smof_data['type_logo'] );