The Options Framework Plugin makes it easy to include a full featured options panel in any WordPress theme.
Although this plugin is still maintained and secure, the recommended way to add theme options for new themes is to use the Customizer.
Instructions
Download the plugin and activate it on your site.
To learn how to set up the options panel in your own themes, download the Options Check theme from GitHub and use its files as a base. It’s a blueprint for how the Options Framework works with a sample option panel with every type of option you are able to use and a demo of how to display each one on the front end.
Available Options
These are the options available:
- text
- textarea
- checkbox
- select
- radio
- upload (an image uploader)
- images (use images instead of radio buttons)
- background (a set of options to define a background)
- multicheck
- color (a jquery color picker)
- typography (a set of options to define typography)
- editor
There’s also “heading” to define the menu tabs, and “info” if you just want to add some additional information to the panel.
Returning Option Settings
If you look in index.php of the Options Check theme, you’ll see how each option is returned. It should look something like this:
of_get_option( $id,$default );
What if the Options Framework Plugin is not installed?
The neat thing about this plugin is that it isn’t required for your theme to work. Each option should have a default which will be used if the plugin isn’t installed. Take a look at Portfolio Press without the plugin activated to see how it works.
There are a couple ways to let the user know that options are available if the plugin is installed: a notice on theme activation, an auto prompt on activation, notes in the documentation, etc. I’ve left this up to the theme authors to decide how to implement.
Download the Plugin
Download from WordPress Repository
Download Development Version
Additional Tutorials
- Options Framework + Theme Customizer
- Options Framework Sidebar
- Loading Additional Stylesheets from an Options Panel
- Loading Google Fonts from Theme Options
- Color Palettes with the Options Framework
- Options Framework: Sanitization Filters
Future Development
This plugin is not actively developed. If there’s compatibility or bug fixes needed, let me know.
Exporting/Importing Options
If you are exporting SQL databases, this thread might be of interest to you. There’s also a fork of the theme version, where someone built this out: https://github.com/vauvarin/options-framework-theme
Credits
The Options Panel was originally based on the excellent work of Woo Themes and still uses some of their code.
A huge thanks to all the people who helped out on GitHub, including @mfields, @helgatheviking, @celtic7, @samargulies, @mattweibe, @Mamaduka and any others.
Also a big thanks to folks who made donations to pay for a third party code review: Jason Schuller, Mint Idea, Luke McDonald .
[…] usar este framework tienes dos opciones, usarlo como plugin o como “standalone”. Como Plugin tenemos la posibilidad de actualizar la plantilla […]
Devin Thanks for this excellent Framework.
I have a question, why is when I click the “Visual” button of the editor I get nothing? The “text” mode is working fine.
I am using the latest version.
Thanks.
This may be a ridiculously silly question, but I’m a little confused.
I understood everything in the video tutorial and in the written instructions. However, I’m wondering how Options Check/Framework knows which elements to change in the css and page template files?
I understand how to create my own customized options page. I just don’t understand how it relates to the theme I’ve developed. I hope that makes sense!
Hi Tara. It doesn’t- but settings up the options page is the first step. Now, you can get the saved option value with of_get_option( ‘example_option’ ) and do what you like with it. The Options Kit has some examples for outputting inline CSS, etc. You can also look at my Portfolio Press theme.
I received this alert after a scan of my word press site. The only change I noticed was in the file version, from WP3.5 to WP3.6.
* modified plugin file: wp-content/plugins/options-framework/readme.txt
Any suggestions?
I bumped the WordPress compatibility version from 3.5 to 3.6. Why did you get an alert?
devin,
I am running a plugin called Word Fence and it sends alerts – maybe a little too much but I would rather know than not know. Sorry if I caused any problems. Thank you.
Jill
Hi if in my theme i have multiple homepage templates/layouts… can i have input fields to add text only to those homepage.
Sure. You’d need to check if a page was set as the home page, and then get the template name for that page, and if that page template == the page template that requires an option, output the option in options.php. Any option can be wrapped in conditionals.
You say “To learn how to set up the options panel in your own themes, download the Options Check theme from GitHub” i follow that link and can not find a download for that file
so how do i “1) Copy “options.php” from the Options Check theme into your own theme.” without being able to find that file
You need to download the entire package.
It’s all there: https://github.com/devinsays/options-framework-plugin/tree/master/options-check
Hi! I use an associative array in some options. In one example the keys are default, small and large. But the values are diferent because they appear into the select list: ‘Normal (default)’, ‘Small (no thumbs)’, and ‘Large (with thumbs)’.
Then, if I use the function get_option(‘id’, ‘default’) it returns me the value, not the key. I like work with the key because the key is not shown into the select list and it has no spaces, so I can use it as code; p.e., Css classes, etc.
I tried to get the key by using array_keys, but it doesn’t work and I don’t find examples on Internet. What I’m doing wrong? There is another way to do that? Thank you very much in advance :)
Hi Devin, thanks for the tutorial.
I’d like to be able to validate some options.
In my case I need to validate a numeric option “Price”, in order to prevent the user entering alphanumeric values.
Is there a way to add some validation function/code?
Thanks in advance.
There’s a optionsframework_after_validate hook.
I must be missing something here.
I have everything added just like you did in the video. The Theme Options page shows up just fine, the buttons all work, and everything saves perfectly. Although, when I go to output the content, nothing shows up. Here’s what my code looks like within my header.php file:
What am I missing?
Code here (within PHP open/close tags):
echo of_get_option(‘my_id_here’);
My mistake. I guess I was using the wrong “type”
Hi, is it possible to retain the options from a main site to its multisites in a network? The multisites will use the values of the main site when it is created, and the options on the multisites will be updated when it is updated on the main site. I hid some options on the multisites, to allow changes to be made only on the main site, thus I need this persistence for all network sites – Thanks!
hi devin – well impressed with this framework.. is there any way of installing 2 pages of settings.. ive changed the page names to create two pages along with most names on my second page but when i save it saves to the first pages settings and the second page doesnt load saved settings just the defaults? is there an option name i need to change for its own array / saved setting/?
all help would be greatly appreciated
thanks
chris conway
Not real easy to save to two different options. You’d need to hack at it some. The next version of the framework will allow this though.
i sorted it thanks.. hackked away cant wait for the next release. is there anyway to quickly add new field types to the interface switch? if ‘background_1’ with a whole different set of options? i got a few to work but.. well do i need to register them or something?
thanks
Options will be more extensible in the next version of the plugin. For now, yes, you’d need to add them to the switch statement and add a sanitization hook.
could i ask you to send me a quick text example where its allowed html tags? i can work from that thgen to do the rest it be appriciated thanks in advance
chris conway
// If the developer hasn’t explicitly set an option id, we’ll use a default..
how do we set a default? – Thanks
Devin Thanks for this excellent Framework.
but when i use group with two field one editor and another text filed with repeatable . then editor don’t save the value in group.
I am planning to include this into my commercial plugin. Am i allowed to put a prefix in every function name or wrap every function with function_exists? So that when a user installed a options framework plugin or include options framework in their theme it will not have a conflict?
I would prefix your functions. Checking if function_exists will likely cause conflicts down the road.
Thank you for replying to my question. Awesome back-end options plugin!
I appreciate your work, your free plugins is very useful, thank you so much :)
How do I set a default value to a textbox?
I assumed ‘std’ => ‘Default Value’ does the trick but it doesn’t change anything. I want to fetch my blog title into the a textbox. I’ve tryed ‘std’ => get_bloginfo(‘name’) but it’s not working.
That should work. Try resetting to defaults and see if it appears.
Hi Devin –
Had trouble Activating options framework in my WordPress installation …
Fatal error: Cannot redeclare optionsframework_rolescheck() (previously declared in /home5/drronine/public_html/shop/wp-content/themes/organic_shop/admin/options-framework.php:31) in /home5/drronine/public_html/shop/wp-content/plugins/options-framework/options-framework.php on line 61
Any clue?
You’re using an outdated version of the Organic Themes theme. Contact their support team to get the latest.
hello, i have the same ‘fatal error’, but i did downloand organic theme today! are they old?
Disable the plugin.
It would be cool if there could be variable length lists or collections of things.
Hello Deven,
Great work on your options framework it is a great way to create the options for the themes fast and easy. However i encounter a rather strange problem when using a checkbox to hide a dropdown menu and a text input. The dropdown is not hiding properly (it stays visible, but if i tick the checkbox twice it hides). It might be due to my lack of jQuery knowledge, but this seems to work with all other elements, as long as i tested them so far.
{code redacted}
Did you look at the demo I have in Options Check. This is how I set it up:
jQuery('#checkbox-option').click(function() {
jQuery('#item-to-reveal').fadeToggle(400);
});
if (jQuery('#checkbox-option:checked').val() !== undefined) {
jQuery('#item-to-reveal').show();
}
You’ll also want to make sure #item-to-reveal is set to display:none.
Hi Devin, this plugin is not compatible with wp3.8, does you have a way to solve it? when will the new plugin version be updated?
It is compatible. What is your issue?
First time going to use your option framework on my themes, Right now using my own developed options panel. Hope this will help me to build some sophisticated admin panel for my free wordpress themes. Thanks a lot for this wonderful efforts.
Hello, I used this plugin previously and need it again for an Organic Themes theme I’m using. I’m running WordPress 3.7.1 and the Options Framework plugin sates compatibility to 3.6.1. Is there a timeline for a new release? I can’t adjust my theme settings correctly without a valid plugin. Thanks!
It is compatible with the latest version of WordPress. Give it a try. Also, new version of plugin is coming out shortly to improve it even more for WordPress 3.8.
Great, thanks. I did try it and found it to work. I found a comment you made about compatibility shortly after I posted my first comment and gave it a try.
The category name doesn’t work for me. The stories will only display if I use the slug. Bug?
Having a problem with a recent update of the Options Framework plugin. Ran the update and it seemed to go fine and everything seems to work, but I have this persistent message at the top of every window in the Admin side of things
“The Options Framework plugin is required for this theme to function properly. Install now.”
Clicking on “Install now” just takes me to page that gives info on the plugin (here) and that it is already installed, so there is no option to re-install it.
It is indeed installed and Active. I tried de-activating and re-activating but no change. Any suggestion as to how to get this annoying and apparently incorrect message to go away. Thanks!
That is coming from the theme. I’d contact the theme author to see if they have an update.
I’ve updated the Options Framework to v1.7.1 running on WordPress v3.7.1 but the banner at the top of the dashboard page:
The Options Framework plugin is required for this theme to function properly. Install now.
Will not go away. When trying to install, it says that current version is already installed. How can I silence this banner?
tx
That is coming from the theme. Contact your theme author.
How can I add options panel for my plugin using “Options framework”?
What version of framework should I use and what code should I add to my plugin to have options page inside of my plugin?
Hello Devin, when will the new plugin coming out to support wp3.8? I am installing genesis framework but I found the current plugin not compatible with wp3.8. Thank you
Lingg
It supports 3.8 already.
There was just a minor glitch with 3.8. The checkboxes got wider. Very wide.
I was able to fix it by changing the width of checkboxes in optionsframework.css file.
help me can not save iframe, script in textarea
I want to save it all. Where to edit
https://wptheming.com/2011/05/options-framework-0-6/
Hi Devin,
I hope you are well. I have installed and activated the plugin but for some reason it’s not showing up in appearances. Can you help please?
Thanks,
Your theme needs to support it- otherwise it’s just a developer tool. Did your theme ask you to install it?
Hi,
Thanks a lot for a great plugin.
Is there a way to add field that allows users to select multiple images from the media library? Surely there must be a way to store multiple image URLs in an array?
Thanks again!
Hi Pdme. You want to insert a gallery? Yes, it would be possible to build a custom option like that, but one is not currently available with the framework.
I’ve installed the plugin, but I get the following error when I try to activate it:
Fatal error: Cannot redeclare optionsframework_init() (previously declared in /home3/northtg5/public_html/wp-content/themes/discover/admin/options-framework.php:73) in /home3/northtg5/public_html/wp-content/plugins/options-framework/options-framework.php on line 54
Any thoughts/help would be greatly appreciated! I’m stuck at this point. :(
Looks like your theme already has in bundled. Perhaps you don’t need the plugin? I’d contact the theme author.
I installed the options framework plugin to the wordpress website theme, but apparently my current theme does not have support for the Options Framework plugin. What do I need to do to activate the Theme Options section?
Thank you!
The Options Framework provides no options on its own- it’s just a framework to help developers build options for a theme. You would need to hire a developer to build out the options you need.
Really handy! Thank you very much. However, I’m somehow stuck trying to get a textarea working.
Where can I find a working example for the textarea? Especially the
$wp_customize->add_control()
part, which is missing in the/options-check/options.php
file.I talk about the theme customizer here: https://wptheming.com/2012/07/options-framework-theme-customizer/. Textarea is not a default of the customizer, but can be added by extending the class. See: http://ottopress.com/2012/making-a-custom-control-for-the-theme-customizer/
Great plugin Devin!
I’d like to know if it’s possible to put a custom post type tab from wp dashboard to theme options(options framework). If possible how do I do that? please help :(
I’m not sure what you mean by “a custom post type tab”. But you should be able to link to the theme options from anywhere you like.
Hi Devin
I’m trying to echo content on the page which is selected in the options framework. How would I go about doing this?
Thanks
You’ll need to query the post, and then output the_content. http://codex.wordpress.org/Class_Reference/WP_Query
i am a news developer, i can develop themes with codes, but cant create a dashboard menu, this plugin saves my time, thanx a lot
Hi, being acquainted with the options frame work recently i would like to confirm if the options frame work will delete a previously uploaded file on changing the uploaded file with another one?
Many thanks.
No. Items do not get deleted from the media library when using the upload option to replace a file.
[…] Options Framework […]
Thanks for the detailed description of Framework Plugin and with the tutorials it’s damn easy.
If I want to wrap some options of a single tab in a fieldset or some thing like this, then how to do it?
Could it be possible to use “std” value of options as placeholder?
There isn’t a (HTML5) placeholder parameter. You could certainly customize the framework to add one, but there isn’t a way to do it with the current code.
Hi Devin,
I’m using option framework together the wordpress customizer.
I wish to implement a button inside the wordpress customizer that let a user reset all settings to the defaults.
I think that to do that I need to store all the default options values in a specific record in the options table, for example a recprd witha name like ‘theme_options_defaults’
Could you suggest me a way to accomplish this that integrates well with option framework?
I was thinking about a specific hook that store the default options only when a theme is installed.
Any suggestions would be very appreciated.
Thank you very much.
In the Options Framework I simply delete the option to reset defaults. You could do the same. If you wanted to specifically certain options, you could do $options = optionsframework_options() and loop through the array resetting defaults you want.
tried removing all files related to wordpress, and removed all database tables related to wordpress, but can’t seem to delete files related to the options framework plugin. Please help me remove these files. thanks,
I’m not sure what you mean. If you delete the plugin, that will remove the files. If you want to delete database options, they’re stored in the “optionsframework” option, and then individually for each theme.
Thanks Devin. The whole thing seemed weird to me too — I just keep getting this ‘you’re not permitted’ error, when trying to delete the plugin files. I’ll keep trying, and maybe the my host can help.
Thanks,
I recently updated the options framework plugin and now the scrolling, featured posts section on my homepage is off by about a quarter of an inch? And when I you look under Appearance, there’s now two tabs for theme options. Any suggestions?
Can you get in touch with the theme developer? They’re probably loading the second tab from the theme. I’m not sure what would have changed on the output side- but they’re probably the best one to look into that as well.
Pls Helpme No active Plugin..
Fatal error: Cannot redeclare optionsframework_init() (previously declared in /home/oymcom/public_html/wp-content/themes/wpex-pytheas/admin/options-framework.php:35) in /home/oymcom/public_html/wp-content/plugins/options-framework/options-framework.php on line 57
Theme used PYTHEAS
It means the theme has already bundled the plugin (and they aren’t doing a check to make sure the plugin is active). You’ll need to disable the plugin, and then install the theme.
Thank man.. for you help
Just a heads up. The video is not showing up on this page.
Hey Devin, it looks like the video has been removed from this post. Instead I see “Sorry, This video does not exist.” Might want to check that out.
can’t get it to work. . . can you kindly send the video to me or re-upload the video.
Mine issue is quite different. The theme i used, i navigate to the smartpanel section where i uploaded the logo and footer button and i tried saving the settings but it isn’t working and i have the plugin activated. Its only warn that the theme doesn’t support Options Framework plugin. How do i go about it?
Sorry for the video issues. I recorded a new one and updated the post.