What is A Thesis Hook?

What is A Thesis Hook?

 

 

UPDATE!!! Now You can use a plugin for THESIS HOOKS. It makes things super easy for the Thesis Version 1.8 and 1.9. Download the OPEN HOOK Plugin.

Download it Here

 

Thesis 1.7 and below.

Basically, Hooks are used for customizing the Thesis theme. Hooks are a particular part of the theme. Various hooks from thesis 1.6 cover various part of thesis theme layout. You can learn hooks easily you don’t need as much PHP knowledge with the knowledge of these hooks you can customize any part of thesis theme.

There are many default functions in thesis theme so if you want to remove that function and want to insert your own function instead of that you have to use hooks.

 

Functions and Hooks

For using Hooks we need two things one is Functions and another one is a hook.

Functions are used to insert HTML code in your Thesis theme and where that function should be placed.

 

Syntax of Function is:

 

/* Function structure */
function function_name () {

?>

Add your custom html code here

}

You can use custom_functions.php to remove default thesis hooks and insert yours .Below are given code to remove your Default thesis theme Navigation Menu,so How you can do it

/*to remove thesis default nav menu paste this code in custom_function.php */

remove_action(‘thesis_hook_before_header’ ,’thesis_nav_menu’);

To insert your own custom navigation menu add this code

add_action(‘thesis_hook_before_header’ ,’custom_nav_menu’);

Where as custom_nav_menu is the function of your own nav menu .you can write function of your custom nav menu as described above.

How to move default thesis theme navigation menu below header

/*to remove thesis default nav menu paste this code in custom_function.php */

remove_action(‘thesis_hook_before_header’ ,’thesis_nav_menu’);

/* to add thesis default nav menu after header paste this code in custom_function.php */

add_action(‘thesis_hook_after_header’ ,’thesis_nav_menu’);