Web Hosting

Spice Up Your Thesis Site With the Feature Box

Thesis Theme for WordPressUpdate - 17 July, 2012

In Thesis 1.8.4 the concept of 'Design Mode' was introduced.

If you make design or layout changes but they don't show up when you check the front of your site, you're probably not using Design Mode.

See how to fix it here.

Original article starts here:

The Feature Box in Thesis gives you just about the most valuable piece of your site's real estate to do whatever you want with.

You can run JavaScript or PHP in it, use it for rotating images, featured post excerpts or simply add an introductory message, as I've done.

Want to give a more personal welcome to your visitors? That 'Good Morning/Good Afternoon/Good Evening' greeting in my Feature Box is a simple JavaScript snippet, followed by plain old HTML.

But I'm sure you can get way more creative than that! 🙂

You could think of it the same way you'd think of a Text Widget: a blank sheet of paper to which you can add anything you like.

But, unlike a text widget, you can place it above your header, above your content, or above your content and sidebars.

And you can place it on every page and post on your site, the front page only or the blog page only.

All by simply selecting settings on your Design Options page.

So how do you make use of the Feature Box?

The first thing to do is to decide what content you want to place in your feature box and create it.

The reason I do this step first is because you have two ways of getting content into your feature box:

  1. Via a hook in your custom_functions.php file
  2. Via the OpenHook plugin (which I wrote about here)

... neither of which are great places to do your creative stuff!

And if you decide to use the hook in the custom functions file and make a mistake in the coding you're likely to create a fatal error - which you don't really want.

As I've said before: if you're editing your custom functions file always make sure that you can access it via FTP before you start. That way, if you create a fatal error you can still get into the file and correct the problem (or upload a clean version).

So create and view your content to make sure it's to your satisfaction.

Typically I do this in Word (including the HTML mark up), copy and paste it into Notepad, save it as an HTML file and open it in my browser.

Don't worry about the styling at this stage. You can create all your styling in the custom.css file using the .custom #feature_box selector.

Once you're happy with your content you have two ways to insert it into your Feature Box.

Insert content via Thesis OpenHook

If you're not comfortable playing with the custom functions file, or can't get FTP access to it, then you have no choice. You'll have to use Thesis OpenHook (unless you're seriously masochistic).

I wrote about how to use Thesis OpenHook here - check it out if you're not sure of the process.

So, access your OpenHook screen, find the thesis_hook_feature_box hook (it's in the content section), paste your content into the box that comes up, click 'Execute PHP on this hook', and hit the Little Save button.

That's it - you're all done.

Insert content via the custom functions file

You'll need to create a new function, which will be the content you just created, wrapped in PHP tags.

Next you add the function to your feature box hook:

add_action('thesis_hook_feature_box', 'the_function_you_just_created');

Click the Big Ass Save button and you're done.

Positioning your Feature Box

To position your Feature Box on your site go to the Thesis Design Options screen and locate the Feature Box section:

Design Options Feature Box

Click the '+' sign next to the heading to expand the options.

As soon as you select one of the options from the drop-down menu you'll immediately be presented with a further set of options that enable you to define which pages you want it to appear on.

Make your selections, click the 'Big Ass Save' button and you're done.

OK, that's all there is to it - but it's a powerful feature, so make use of it and enjoy!


Martin Malden

Web Hosting