Thesis WordPress Theme – Mastering Custom Hooks and Functions in Thesis
Thesis is a very flexible theme. It can be customized very easily using what developers call "Thesis Hooks."
Thesis Hooks can change every part of your WordPress blog. In this WordPress tutorial, I'm going to show you how to modify your Navigation Menu.
You have probably noticed that the default installation always has the Navigation Menu on top of the default screen. You can change the default location by using Thesis hooks. By using Thesis Hooks, you can move the Navigation menu to appear below the blog title and blog description.
So, let's get started with using custom hooks and functions in the Thesis theme for WordPress.
Follow theses steps:
- Access the User Guide
- Find the support page
- Click on Thesis Default Hook Usage
- Access the Member's Area
- Find, click, and read the page called "How to Customize Like a Pro with Thesis Hooks"
- Access the link "Make Your Header Display Above your Navigation Menu"
- Find the appropriate code, and copy it
- Return to your WordPress blog
- Paste the code in the entry box in Custom File Editor
Thesis Default Hook Usage:
Go ahead and access the Thesis Theme Member's Area to get started. Hooks and which actual hooks are needed to achieve different looks on Thesis. Generally speaking, each function requires a pair of codes. The first code is called the function. The second code is called the hook. You need to enter both of these codes in order to build a custom function in Thesis.
Find the page called "How to Customize Like a Pro with Thesis Hooks." There, you will find a tutorial including real examples. Go ahead and click on the link to access the tutorial. Feel free to read through the entire page.
Next, find the link called "Make Your Header Display Above your Navigation Menu." Find the code, and then copy it. Next, return to your WordPress blog. You will paste this code in your Custom File Editor.
Enable your Thesis hook functions by changing WordPress settings:
- Find the Thesis Options tab
- Click on Custom File Editor
- Select the custom_functions option
- Click on Edit Selected File
- Access WordPress using FTP
- Click on wp-content
- Click on Themes
- Click on Thesis
- Click on Custom
- Access the custom_functions.php page
- Right click the link
- Choose File Permissions
- Change the permissions to 777
- Click on OK
The next step is to find the Thesis Options tab. Click on Custom File Editor. Then, from the drop-down menu, you can either select custom.css, layout.css, or custom_functions. For this purpose, you need to select the custom_functions category. Then, click on Edit Selected File. In order to run custom_function, you need to set up the correct file permissions on your WordPress blog.
Access your WordPress site using an FTP application. Then, click on wp-content. Click on Themes. Then, click on Thesis. Next, click on Custom. You will see the custom_functions.php page. Right click this link, and then choose File Permissions. Change the permissions to 777 and then click on OK.
Move the Navigation Menu by using Thesis Hooks
- Return to Member's Area
- Remove the Thesis Navigation menu using thesis_hook_before_header
- Copy the code
- Go back to Thesis Custom File Editor
- Find entry box, paste the copied code
- Click on Save
- Refresh the page to verify settings
For now, let's return to the Members Area code again. In order to make the Navigation Menu move from the top to the benefit the header, there are two sets of actions that need to be completed. The first is a remove action, which is to remove the Navigation Navigation menu from the current location of thesis_hook_before_header.
The second action is to add the action back into the appropriate area on Thesis Hooks. Copy this code, and then go back to the Thesis Custom File Editor. Once you are on the Thesis Custom File Editor page, you will see comments and notes that appear by default. These comments and notes show you how to add custom hooks, or custom functions. Find the entry box, and paste the copied code exactly as it appeared in the Members Area example. Then, click the Save button.
After you have clicked save, it will confirm the changes. Refresh the page. Now, take a look at the changes. You can see that the Navigation Menu now appears before the header and benefit the blog title and description.
Remove the Thesis Attribution Link using Thesis Hooks
- Click on the link "Get Smart with the Thesis WordPress Theme from DIY Themes"
- Return to Member's Area to access the code format to remove a function
- Find the specific Thesis attribution code link
- Copy the code
- Return to File Editor
- Paste the copied function
- Go back to Support Area
- Click on User Guide
- Find Thesis Default Hook Usage
- Find and click on the pair of codes called Thesis Attribution
- Copy the function
- Paste the function into the entry box
- Copy the hook
- Paste the hook into the entry box alongside the function copy
- Click on Save
In the next example, let's discuss removing the Thesis attribution link. If you want to remove the default Thesis attribution link, click on the link that reads, "Get Smart with the Thesis WordPress Theme from DIY Themes." Go back to the Member's Area to find the code format to remove a function. Find the code for the Thesis attribution link. Copy the code, and then go back to File Editor. Right below the body of text, go ahead and paste the copied function.
Next, find the correct hook name and the correct function to complete the process.
Now, go back to the Support Area. Click on User Guide. Then, look for Thesis Default Hook Usage. Once you have accessed the page, you will find a useful example as to the pair of codes that are needed to make this change work. Click on the codes, and then find the one called Thesis Attribution.
Next, copy the function. Then, paste the function in the entry box. Now, copy the hook. You will paste the hook into the entry box along the function copy. Click on Save. Then, you will be prompted with a confirmation message. To confirm the changes, refresh the page and the footer should be gone.
By using Thesis Hooks, you can automatically customize Thesis however you want. If you need additional help, you can use online support forums and the user guide. The forums are active with a lot of advanced WordPress and Thesis users. Using the available resources is helpful if you run into any customization issues using Thesis Hooks for WordPress.