How do I output all of the $options variables from the options framework?
Do you know the option name? It’s usually set all the top of options.php.
If so:
$options = get_option('theme-option-name');
var_dump($options);
Ok, and if I have multiple options? How would I write that?
When I add your code to the top of my options.php page (and replace ‘theme-option-name’ with my option name), the visual output at the top of my site is “bool(false)”. Does that help narrow down my problem?
So I’m feeling I’m not giving you a whole lot of info…
In my functions.php file, I have this code:
if (!function_exists('of_get_option')) {
function of_get_option($name, $default = false) {
$optionsframework_settings = get_option('optionsframework');
$option_name = $optionsframework_settings['id'];
if ( get_option($option_name) ) {
$options = get_option($option_name);
}
if ( isset($options[$name]) ) {
return $options[$name];
} else {
return $default;
}
}
}
Do I need to add an include to options.php anywhere on my functions.php page?
Ok, after re-reading the information on your site AND re-watching a few of your videos regarding this framework, I FINALLY saw the line at the top of the Options Framework Theme:
<?php echo of_get_option('theme-option-name', $default); ?>
It works. I was originally following someone else’s tutorial that said to output this (which didn’t work):
<?php echo "$theme-option-name"; ?>
I’m not quite sure where you’re getting hung up. There’s a ton of example code on the site.
Try downloading the version on GitHub:
https://github.com/devinsays/options-framework-plugin
Copy “Options Check” to your theme directory.
It has an example of every option, and how to output every option.
I got it fixed. I was using an incorrect way of echoing the variables (thanks to some random tutorial). Once I changed my echo from this…
<?php echo "$theme-option-name"; ?>
to this…
<?php echo of_get_option('theme-option-name'); ?>
…everything worked perfectly.
The only place I could find an example of how to echo out the options was by installing the Options Framework Theme. That echo information isn’t anywhere else from what I could see. But anyhow, thanks for the replies and great job on the plugin!