OpenHook – Makes Modifying Thesis Theme Easy

by Matthew on May 29, 2009

thesis-openhookRecently I switched to the Thesis theme on a few of my WordPress blogs including my main site GadgetVenue. After uploading the Thesis theme for the first time like me, you will probably go to the theme editor to start hacking away… but in Thesis the HTML is way different to your average theme. The reason for this is that Thesis uses hooks to modify the look and add different functionality in to your blog. By using hooks it allows you to change the look of your site without modifying the core code of wordpress or the Thesis theme. When that dreaded time comes to update your theme or wordpress all you simply do is upload the latest update and all your modifications are kept safe in a custom folder. The downside is that it’s quite complicated at first to learn the code and how to get it to work as Thesis customisations are slightly different to what is normally used when editing the HTML direct. This is where OpenHook comes in to play as it makes Thesis very easy to customise. Lets take a look at what it can do.

OpenHook is a plugin that you install like any other plugin on WordPress. Once uploaded and activated it “bridges the gap between you and the inner workings of Thesis”.

Most WordPress themes require you to edit the actual theme files — or create child themes — to customize your site. That’s a hassle, especially when it comes to upgrading.

Once activated, OpenHook has a simple interface with a text entry box for each of the hooks you can use. By simply pasting your PHP code or regular HTML in to the hook you want to use you then hit save and the job is done. What else can be done is editing of the custom.css file within the interface allowing you to change the whole style of your site without touching the core code of Thesis.

An example of how you can modify the theme can be seen by the following 2 snippets of code…


< ?php if (is_archive()) { ?>
AD CODE
< ?php } ?>

< ?php if (is_single()) { ?>
CODE
< ?php } ?>

The top section of code could put some ad code like Adsense for example on to a page. The is_archive section means that if you are viewing an archive page then execute the AD CODE. Like wise, the bottom example shows an if_single which indicates the CODE in-between the tags will be executed when you are viewing a single page. To add further to this you can also modify the code slightly to show code on a specific post or page by specifying the number of the post.

The plugin has been a great addition to TechAsis and for anybody wanting to use the Thesis theme, it’s well worth checking out.

{ 2 comments… read them below or add one }

1 yudika October 28, 2009 at 8:23 am

hello mattew. i really need some help, maybe you can help me.

i’m a thesis theme new user, i’m little bit confuse when i need some modification in “search result page”, could you help me please, to show me, which part of thesis code that organize search result page?

in kubrick theme i can found it easily in search result.php.

i really appreciate if you can help me.

thanks a bunch for your attention

Reply

2 Matthew October 28, 2009 at 8:37 am

Yudika, could you register over at http://www.techasis.com/forums/ and post in the Wordpress section (I am about to go create that now). The forum is practically brand new with no posts yet. Rather than discuss it here it would be good to discuss there so the conversation isn’t potentially broken up with other comments if that makes sense :)

Once there I’ll certainly help you work out what you need to do to get the search results page working as you need it to.

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: