Login

How to Customize Your Site Intelligently with Hooks

by Chris Pearson

Back in the old days, if you wanted to modify your theme, you had to make all of your custom HTML changes to individual template files. Then, if you ever had to upgrade or – god forbid – change your theme, you had to make those same HTML changes all over again.

I think we can all agree that the “solution” above is terrible, but why? Ultimately, it’s a poor customization solution because it’s so unforgivably inefficient. Your changes are thrown in alongside core template code, rendering your entire theme a hacked-up, vulnerable mess.

If you’re concerned about running an efficient, well-oiled machine of a Website, then you have to do better than this. Specifically, you’ve got to have a framework that allows you to make HTML customizations that are:

  • futureproof, or immune to upgrades
  • standardized for easy inclusion and formatting
  • easy to manage
  • easy to understand

Designed with these principles in mind, the new Thesis hook system allows you to make intelligent, powerful, and efficient customizations that have never been possible before. The sky is the limit here, as evidenced by the completely-revamped Copyblogger design which now runs on Thesis!

To help you learn how to use hooks effectively, we’ve prepared a detailed, example-based tutorial for the User’s Guide:

Also, we’ve added a couple of new reference pages for the Thesis hook system, including:

If you haven’t upgraded to Thesis 1.3 yet, you should really consider doing so in order to take advantage of the hook system. I’m using it here on DIYthemes to handle all the customizations you see, including the login bar at the top of the page and even a few of the sidebar widgets.

The bottom line is that no matter how big or how small the customization, using the hook system to implement it is the intelligent choice.

In other words, it’s what a ninja would do :D

{ 13 trackbacks }

In the Coracle » » links for 2008-10-31 » “It’s almost like you’re writing a book one post at a time” - Kedge
October 31, 2008 at 4:28 pm
Thesis – eines der besten Premium-Themes für WordPress - - FirstDayBlack
December 16, 2008 at 8:07 am
Google AdSense: Wordpress And Thesis
December 26, 2008 at 7:55 pm
Why Thesis Rocks for Web Developers
February 27, 2009 at 4:40 pm
WordPress Wednesday: Thesis Theme Tag Text — davidgagne.net
June 17, 2009 at 5:47 am
Learn CSS Quickly & Easily with Thesis | WPblogger
June 23, 2009 at 3:32 pm
Chazography – Remove Comments Closed Text
June 24, 2009 at 10:03 pm
100+ Thesis Theme Resources | Cho Toan dot Com
August 5, 2009 at 6:59 pm
250+ Thesis Theme Resources | Sahil Kotak dot Com
December 8, 2009 at 11:25 am
Thesis Theme and Hooks Reference Guide | Inside the Secret Life of a Super Affiliate - Zac Johnson dot Com
January 5, 2010 at 7:59 am
Thesis Theme and Hooks Reference Guide | Tamasindo Secret & Technology
January 5, 2010 at 8:03 am
Tutorial Showing How To Add A Custom Background Graphic To The Thesis Wordpress Theme | Logos for Websites
January 13, 2010 at 7:33 pm
Thesis Theme and Hooks Reference Guide « MarketingTypo.com
January 14, 2010 at 1:26 am

{ 57 comments }

Chris Pearson January 18, 2009 at 9:49 am

Kevin — In order to edit your custom_functions.php file, you’ll need an external text editor like Notepad++ for Windows or TextWrangler for Mac. You are likely trying to find and edit these files from within your WordPress administration panel, and that’s not something you can do at this time.

Kevin January 18, 2009 at 12:41 pm

Hi Chris,

Thanks for getting back to me. Unfortunately, I don’t even know what you are talking about. For now I am satisfied with the theme. Actually all I want to do is fiddle with the theme so it looks like the background of this page. I think what I need is some kind of video tutorial. Thanks again for a dynamite theme.

Thesis Web Graphics January 19, 2009 at 12:18 am

Hey Guys, Just wanted to let you know that I have a special deal for thesis users. I will be deisgning custom Header & Rotator Graphics at a very affordable rate to help make your blogs stand out and get noticed. “SPECIAL THESIS GRAPHICS from only $39″
Regards
The Pro Designer

Will Lowrey January 27, 2009 at 8:13 am

I am loving Thesis. So, I figured I would share a quick little function for you hook-loving folk:

I first saw this on a different site talking about the ‘Tweet This’ plugin. The author then made a comment about adding it to single.php. Well, since that is not what I wanted to do – I put together the following:

function custom_tweet_this() {
    global $post;
?>
<a rel="nofollow" href="http://twitter.com/home/?status=Reading @WillLowrey - <?php the_permalink(); ?>">Tweet This Post!</a>
<?php
}

add_action('thesis_hook_after_post', 'custom_tweet_this');

Edit the Twitter username (I used mine above), and make sure you grab the image for the little twitter bird – but then you have your own Tweet This without a plugin and without editing the source. Just add it to custom_functions.php.

Enjoy

Daniel M. Clark January 27, 2009 at 12:53 pm

Will, that’s awesome – but I have one question. I’m not familiar at all with funneling things through TinyURL or bit.ly, and since permalinks can be reeeeeally long, do you know of a way to do that in the code?

birdyoshi January 30, 2009 at 4:35 pm

The level of php knowledge needed to use your hooks, is enough that wordpress creators can make their themes. And this is what I can’t understand. I’m not a critic — I’m a fan of what you’re doing, but I just wonder why anyone who can understand how to implement these hooks would be buying a theme instead of building their own…

That said, Sir, more power to you, and I hope are very successful in 2009.

birdyoshi January 30, 2009 at 4:41 pm

Sorry, a question about “futureproofing”… (you can see that I’m looking seriously at Thesis)(^_^)…
I made my own themes by making templates, which in your calculation is not futureproof. But I always upgrade with no problem, and I can reuse code over several themes with little trouble. What am I missing?

Comments on this entry are closed.

Previous post: Everything You Need to Know About Cosmo

Next post: Thesis 1.3.2 Brings Compatibility, Fixes, and General Awesomeness