Add An Options Page To Your Theme With The NHP Theme Options Framework

in Blog

The NHP Theme Options Framework is an easy to use free options framework from Freelance Graphic Designer Lee Mason.

On the framework home page Lee acknowledges other great option frameworks such as Options Framework Theme and The UpThemes Framework though points out that neither of them provided him with the extendibility he needed. Specifically he wanted:

  • Section Tabs – Each settings section to have its own “tab” which can be clicked through.
  • Use the WordPress Core Settings API – The settings to use the core WordPress functions for creating/editing settings (no point reinventing the wheel).
  • Custom Error Handling – To be able to display error totals and custom messages for each section/setting.
  • Easily Extendable – To be able to extend the framework for custom use applications, settings fields and custom validation.
  • Customisable – To be able to customise the functionality and style without hacking at the core.

NHP Theme Options Framework

Adding the options to a theme is incredibly easy. You first need to upload the theme-options.php file and options directory to your theme folder (e.g. and Then you need to request the theme-options.php file from your theme via your theme functions.php file.

require( dirname( __FILE__ ) . '/theme-options.php' );

Once you have added the above line to your theme functions file, you will see a new Theme Options page underneath your appearance section. The framework supports a 28 field types including textareas, check boxes, dates, colours, post type selector and info field.

NHP Text Fields

The framework includes lots of validation classes such as no HTML, date validation, colour validation and string replacement.

NHP Custom Fields

The framework comes with an import and export system built in so that users can save what their configurations.

NHP Import & Export

A number of custom message phrases are included with the framework such as ‘Settings Saved’ and ‘Settings Imported’.

NHP Error Messages

I’ve not developed a theme with a custom options page so I am not in a position to compare it to other option frameworks out there. It does appear to be a very good option though due to it’s flexibility and number of field types to choose from. The code has comments throughout and it is well documented too so you shouldn’t have difficulties modifying it for your own website theme.

More information can be found at the link below.


Link: NHP Theme Options Framework

Comments (3)

  • Comment by Lee Mason
    Lee Mason

    Hello All,

    This is a really old post, but just thought i would update up.

    Im the creator of the framework, and since then i couldn’t maintain it as a free open source offering.

    However i do now offer a premium framework, which does what this did and much more:

    Its premium but a small contribution for a hell of a lot more options and features.

  • Comment by Ghost1227

    I always loved NHP… unfortunately, it hasn’t seen development in six months and the bugs and feature requests have been piling up. As a result, I got tired of watching problems go unsolved, forked NHP, and released my own framework which resolves most of the issues people had with NHP and adds a few features of my own! If you want to take a look at my continuation of NHP, check out

  • Comment by mandava

    This is quite interesting, will add options panel to my basic wp theme.