Web Hosting

Thesis Tips: Thesis-OpenHook Plugin

Thesis for WordPressThe first thing I do when I create a new installation of Thesis is install the Thesis-OpenHook plugin.

One of the most powerful features of Thesis is the custom-functions.php file. It enables you to move different elements of your page around and add bits and pieces wherever you want.

But if you're not a PHP coder you're a bit stuck. Enter Thesis-OpenHook.

You can add Thesis-OpenHook through the 'Add New' button on your plugins page, (just search for 'thesis-openhook') or download and install it manually from here.

Once it's installed and activated it will appear in your 'Appearance' sub-menu:

Thesis OpenHook

What Does Thesis-OpenHook Do?

It enables you to make use of Thesis hooks without needing to know how to write PHP.

As long as you know HTML, CSS or JavaScript you can add any kind of content or function to any of the Thesis hooks and two of the WordPress hooks.

For example you can add personalised content to the footer of your site and style it however you want. Here's an example of adding a customised footer (sorry the pic is so small - I've described what I did below):

Thesis OpenHook

All I've done is add the content I want to display, and a bit of in-line CSS to style it, to the box against the Footer hook. Just as if I was writing a normal HTML page.

Always be sure to check the 'Execute PHP on this hook' check-box if you have any code that needs executing. The plugin will then apply the necessary PHP to the code you've entered and you're all done.

Thesis-OpenHook gives you access to 55 hooks altogether, which include the WP-Header and WP-Footer hooks - parts of the page that aren't displaid to viewers, but contain the META tags and other scripts that the search engines or browsers use.

How do I Use It?

Clicking on the Thesis OpenHook link in your Appearance sub-menu will bring up this screen:

Thesis OpenHook

Use the drop-down menu in the box that floats at the bottom right to find the hook you want to edit and click on it to go directly there:

Thesis OpenHook

The names of the hooks are pretty self explanatory. They all start with 'thesis_hook_' and the words that follow indicate which hook it is.

When you've found the hook you want to edit just add your content and any styling, check the 'Execute PHP on this hook' check-box and click the 'Little Save Button'.

Tip: If you're not sure which hook you want to edit pick the one that you think you need, do your stuff, save and then view your page.

If what you just did isn't positioned where you want it, return to Thesis-OpenHook, go to the hook you just edited, cut everything in the box (so that it's added to your clip-board), uncheck the Execute PHP check-box, and paste your code into the hook immediately before or immediately after.

Check the Execute PHP check-box, hit Little Save and view your page.

You can repeat that process as many times as you need until you have your stuff in the position you want it.

What's a Typical Use for Thesis-OpenHook?

I use it on most Thesis sites I build to move the main navigation menu from above the header (the default location) to below the header.

Simply paste the navigation menu PHP call (which you can copy from the instructions below the 'Before Header' hook) into the 'After Header' box, check the 'Execute PHP on this hook' check-box, check the 'Remove Thesis nav menu' check-box in the 'Before Header' hook, and hit Little Save.

Important note: Thesis-OpenHook doesn't actually write to your custom-functions.php file, so if you deactivate the plugin the edits that you've made will all disappear.

So be sure to keep the plugin activated once you've done any editing!


Martin Malden

Web Hosting