Introducing NHP: A New, Extendable Theme Options Framework for WordPress

Today we’d like to introduce you to a new tool for WordPress theme developers. It’s a theme options framework that we think you’re going to fall in love with.

NHP Theme Options Framework was created by developer Lee Mason of No Half Pixels. Though there are many other options frameworks already available, Mason’s goal was to build something that would be easily extendable and support custom error handling. The NHP options framework is launching with a ridiculous number of features.

Some of the NHP framework’s most remarkable features include:

  • Custom Error Handling – Using the Validation methods you can create custom error messages for each field type.
  • Extendable Field Classes – Easily create custom field classes for use in your theme options. Instructions are available in the detailed wiki.
  • Built In Field Types – Contains many built in field types for easy use (all basic field types like text, checkbox, select, upload are built in).
  • Extendable Validation Classes – Want custom validation? Just use the extendable Validation Class methods.
  • Built In Validation Methods – Contains many built in validation methods for clean data saving (email, url, numeric, escape js, no html, html).
  • Fully Customizable – Many Hook points to customise the Framework to your requirements.

This is just a sampling of the built-in field types:

I highly encourage you to visit the NHP framework’s homepage on github to explore the vast number of built in features. The best part is that every function/action can be customized.

Simple to Use:

Including the options framework in your theme is very easy. You simply require the theme-options.php file in your themes functions.php file, like this:

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

Then you can change the settings as written in the theme-options.php file.

The documentation for NHP is extensive and will continue to grow as new hook points and configuration options are added with each update. This options framework is a theme developer’s dream. It enables you keep your focus on creating beautiful themes. The NHP Theme Options Framework is definitely a tool you’ll want to bookmark for future use.

Tags

Comments (6)

  1. I want this built into WordPress 3.5. There is no reason why there need to be thousands of different theme WordPress frameworks that all accomplish the same thing.

    If developers want to opt-out, that’s fine, but new developers should have something this good to start building with (similar to how WooMenus got integrated into core).

  2. First of all thanks sarah for the article, its great and most definatley better sales copy than i can manage for myself on the framework page (not much of a writer).

    To the above ^^^

    I agree something like this should be part of the WP Core. They have started with the Settings API, which this framework uses, but i dont think its on there roadmap at present.

    I would love for the guys at WP to approach me about making it core.

    The problem is everyone wants different things from a settings page, thats why ive tried so hard to make this completley extendable. I know not everyone will want to use it as many have there own frameworks (like woo themes, and similar).

    But there are also many smaller theme designers that want something different to default WP, but also don’t want spend the time creating it from the ground up.

    Thats the market this is targeted at.

    Its still very new, and any improvements or suggestions are very welcome, if you visit the github page you can submit issues (and i would encourage that).

    Thanks again sarah, 5 stars.

  3. 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 https://github.com/ghost1227/Redux-Framework/

Participate