Options Framework Theme

The Options Framework Theme has all the code included to build a out a full featured options panel. It’s a bundled version of the Options Framework Plugin for those folks who want to build the options directly into the theme (rather than relying on a plugin).

This project was released long before the Customizer was a part of WordPress. The Customizer is now the recommended way to add theme options and you can read more about it here. If you want a helper library for the Customizer along with a few other tools for developers, try the Customizer Library.

That said, the Options Framework may still be useful for some projects, and you’re welcome to try it out.

Available Options

  • 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


Copy the “inc” directory, options.php, and the code snippet in functions.php from the “Options Framework Theme” into the theme of your choice. Hack away. You can also watch the video above to see how it is done.

When to Use Theme Version vs. Plugin Version

The code is 99% the same between the plugin and theme version. If you can do what you need with the plugin version, I think that’s the best route. If you find that you need to make significant modifications that aren’t possible with the plugin, go ahead and use the theme version.

Change the Menu Location

It’s highly recommended that you leave theme options under the “Appearance” menu where users expect them.

But, if you do decide to change the menu location it will break the media uploader. This is because the media uploader scripts are enqueued on $of_page= ‘appearance_page_options-framework’ in options-medialibrary-uploader.php. If you change the name or location of the menu, you’ll need to update the hook to be accurate, e.g. $of_page= ‘toplevel_page_options-framework’ and those scripts will load properly again.

Sanitization Filters

If you’re interested in how the options data is verified, or if you’re wondering why your script and embed tags are stripped out in the Options Framework, read this post.

Can I Use This Code in Commercial Themes

Yes! This code is 100% GPL. Please read the included license for more details.

Development Version on GitHub

The development version of the Options Framework Theme is available on GitHub.

Additional Tutorials

Purchase the Options Framework Theme Kit

The Options Framework Theme Kit, which includes the latest released version of the Options Framework Theme plus a collection of demonstrations themes is available for $30. You’ll be able to download updates and get new child themes as they are released.

831 Responses

  1. Xeeone Kim

    Hi, now I’m trying to create my own plugin and its options, but I have no idea about the line of code ” $location = apply_filters( ‘options_framework_location’, array(‘options.php’) );” in class-options-framework.php file. Once I included options.php into the THEME folder then it works, but I need to include options.php file in my PLUGIN folder(now this causes an error like this: Your current theme does not have support for the Options Framework plugin.). How can I edit to do so? I had changed the line above into “$location = plugin_dir_path( __FILE__ ) . ‘/options.php’;”, but It didn’t worked. Thanks!

  2. I’m using options framework for my premium theme, everything was going well but I just realised today, it saves only first few options and just ignores last few options. May be I have too many options in my options panel page. Is there any limit to add maximum number of options? How can I increase the limit so that I could add unlimited options. For now may be I have more than 500 options added to my options panel. Please help.


  3. Hi, i am using Options Framework Plugin with my custom theme. Its works fine with it. But after installing Image Gallery Plugin, I am unable to see the Image Gallery Plugin setting options. If i disabled Options Framework Plugin, it works fine. I think, Options Framework Plugin conflicts with the Image Gallery Plugin.

  4. I just wanna say thanks (not just in words but with money too) because your framework has helped me really really a lot.

    Simple, fast, asesome, nothing more to say but huge many THANKS!

  5. Hi there. Many thanks for the awesome thing you have here. Ok here is the issue.
    I got defined an imagen size “CATEGORY (550×550)” in my functions.php
    I got an upload field in the Options Framework.

    Now … I want to get the image in that size.

    How can I do that?


      1. By the way. I have followed the steps but at the final part there is some missing images (inhttps://github.com/devinsays/options-framework-plugin/issues/138) so i can’t figure out what I really have to do!

      2. This happens to me a lot. After ask i figure it out by myself.

        1.- Paste this into your functions.php

        /* Obtenemos ID de las imagenes */
        function mb_get_attachment_id_from_url( $attachment_url = ” ) {

        global $wpdb;
        $attachment_id = false;

        // If there is no url, return.
        if ( ” == $attachment_url )

        // Get the upload directory paths
        $upload_dir_paths = wp_upload_dir();

        // Make sure the upload path base directory exists in the attachment URL, to verify that we’re working with a media library image
        if ( false !== strpos( $attachment_url, $upload_dir_paths[‘baseurl’] ) ) {

        // If this is the URL of an auto-generated thumbnail, get the URL of the original image
        $attachment_url = preg_replace( ‘/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i’, ”, $attachment_url );

        // Remove the upload path base directory from the attachment URL
        $attachment_url = str_replace( $upload_dir_paths[‘baseurl’] . ‘/’, ”, $attachment_url );

        // Finally, run a custom database query to get the attachment ID from the modified attachment URL
        $attachment_id = $wpdb->get_var( $wpdb->prepare( “SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = ‘_wp_attached_file’ AND wpostmeta.meta_value = ‘%s’ AND wposts.post_type = ‘attachment'”, $attachment_url ) );


        return $attachment_id;

        2.- Get the image normally to a var:
        $catimg_01 = of_get_option(‘mb_cat_01_img’);

        3.- Use this var to get the Attachment ID:
        $catimgID_01 = mb_get_attachment_id_from_url($catimg_01);

        4.- Get the TAG image with the size you need
        $catimgTAG_01 = wp_get_attachment_image($catimgID_01,’medium’);

        And … done!!!

        Many thanks for the clue Devin!

  6. Paolo

    Hi! I installed theme option plugin. I tried to modify the option like the color pucker, background color, etc… However when I tried to change the color of my background nothing is happening. What sort of step do I need to achieve this?

Leave a Reply