I replaced the setting_name with the setting I'm trying to get from my theme; I'm not sure about the first parameter so I tried it and a few others; still no luck.
theme('get_setting', 'setting_name')
I'm beginning to think I need to get it from the system table; but I'm not sure how to parse it; I'm sure there is an API call; anyone know what it is?
// Get an array of settings for Theme
$settings = theme_get_settings('Name-Of-Theme');
// Now find the one you need
$themeSetting = $settings['Setting-Name'];
Comments
Example
This will return a NULL if called in a module but not if called from the theme:
$tempSetting = theme_get_setting('SETTING');
I believe calling this in a
I believe calling this in a module is to early in the process.
Try a variable_get('setting_name')
I might be wrong on this one. Also if it works. It might not be the most up to date settings.
But you can try.
Eric
Yes, I did try this; it
Yes, I did try this; it returns a null; its like the Theme has not been initialized yet.
Hi jflesher!
The right art to useeach theme is:
So as you use it, it returns nothing becouse the function wait for the secund parameter.
i hope it help you.
I replaced the setting_name
I replaced the setting_name with the setting I'm trying to get from my theme; I'm not sure about the first parameter so I tried it and a few others; still no luck.
theme('get_setting', 'setting_name')
I'm beginning to think I need to get it from the system table; but I'm not sure how to parse it; I'm sure there is an API call; anyone know what it is?
Thanks
To answer my own question and mark the [Solved]
// Get an array of settings for Theme
$settings = theme_get_settings('Name-Of-Theme');
// Now find the one you need
$themeSetting = $settings['Setting-Name'];