free hit counters
If you are using Internet Explorer as your browser please be running at least IE 7 or above. This site does not support IE 6 or below. Go here for the latest free version including easy download and installation instructions If you want to make it real easy on yourself, download Firefox , the most popular browser in the world. It's free and simple. You'll be so glad you did.
Feb
11
2009

OpenHook basics

The Thesis OpenHook plugin is really easy to use once you get the hang of the hooks that it uses. I’m going to try to simplify this even more by given you a real simple function to use as an example. First thing you need to do is check out the hook map (which is located in your tool box on the left side of this page). Get familiar with where each hook gets place on your blog.

Let’s say you want to place some custom text at the top of the content box

In your custom_functions.php you can add this code…

function simple () {
echo ‘this is a real simple function being placed with the OpenHook plugin’;
}
add_action (’thesis_hook_before_content’ , ’simple’);

This is the result…

1121

Now you can get the same result without touching your custom_function.php file and using the OpenHook plugin.

Go to Dashboard —->Appearance —->Thesis OpenHook

Scroll down until you get to this section and add this code…

113

Hit the little save button at the bottom and that’s it!

So basically what the plugin allows you to do is add a function through your dashboard. Check out the original code compared to what you type in the plugin box. The plugin makes it easier to write functions, save you typing time, minimize typing errors and wrong coding. You don’t have to type in the beginning function code, or the end add action code, where you may make errors, forget brackets, and type the wrong code.

To download and install this plugin, click here

Leaving a comment with code in it...

If you would like to leave a comment and you have examples of code you want to show, you must "escape the code". This allows the entire code to show correctly by inserting certain variable around certain tags to make them show. If you don't "escape the code" your code will show up broken, mangled, and it won't be able to be seen correctly. "Escaping the code" is very simple...

  1. Copy your code you want to show
  2. Click here to go to the site to escape the code
  3. Follow the directions, it's so easy
  4. Once you have the escaped code copied, paste it in the comments area where you want
  5. Now you can enjoy life


Go ahead, leave a comment...

Leave a Comment

Previous post: Positioning the feature box

Next post: Add a page to your nav bar