print theme_get_setting in php-as-css file I'm trying to print out settings from my theme's theme-settings.php into a file called custom.php. Below is the code I'm using in custom.php:

&lt;?php
    header("Content-type: text/css; charset: UTF-8");
define('DRUPAL_ROOT', '/path/to/my/drupal/installation');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
?&gt;

body {
    background: url(&lt;?php print (theme_get_setting('theme_custom_background_path')) ?&gt;);
?&gt;;


This is what the result is when the page is rendered in the browser:

body {
    background: url();
}


I'm obviously missing something here -- theme_get_setting isn't working. I'm not sure what kind of code I need to link this file to my theme.

Does anyone know if there is a way to get custom.php to recognize the settings I've defined in my theme's theme-settings.php file with theme_get_setting? I feel like I'm so close but just missing a few lines of code.

At the end of the day if I absolutely need to, I can just print the settings out inline within the head section of html.tpl.php - but I'd much rather include them in a separate stylesheet with the .php extension.

Any suggestions?
Below code worked for me ! Make sure there is a value for setting "theme_custom_background_path" in your theme settings. For example i can able to get logo path of theme using below code


Created a file called get_setting.php inside my Drupal Root
Copy pasted below code
Executed in browser.


Code

define('DRUPAL_ROOT', getcwd());
include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$theme_settings = theme_get_setting('logo');
print "body { background: url(" . $theme_settings . ");}";