How To: Add/Remove Thesis Elements using custom_functions.php

by Greg Rickaby on November 3, 2009

If you’re designing Thesis skins for clients on your own test server, you will find yourself doing a lot of redundant work when it comes time to export to a live server. I will show you how to add/remove Thesis elements to save you this headache.

add-and-remove-thesis-elements

In custom_functions.php you can copy & paste any of these snippets after the <?php

Nav Menu
remove_action('thesis_hook_before_header', 'thesis_nav_menu');

Search Box
add_action('thesis_hook_before_header', 'thesis_search_form');

Header (Title & Tag-line)
remove_action('thesis_hook_header', 'thesis_default_header');

Post Tags
remove_action('thesis_hook_after_post', 'thesis_post_tags');

Comment Link
remove_action('thesis_hook_after_post', 'thesis_comments_link');

Post Navigation
remove_action('thesis_hook_after_content', 'thesis_post_navigation');

Previous/next post navigation
remove_action('thesis_hook_after_content', 'thesis_prev_next_posts');

Subscribe to Comments plugin compatibility (If you’re using the “Subscribe to Comments” plugin)
remove_action('thesis_hook_comment_form', 'show_subscription_checkbox');

Archive page information box
remove_action('thesis_hook_archive_info', 'thesis_default_archive_info');

Thesis Attribution (Developer license only)
remove_action('thesis_hook_footer', 'thesis_attribution');

Footer scripts
remove_action('thesis_hook_after_html', 'thesis_footer_scripts');

Custom Homepage Template
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');

Default 404 Title
remove_action('thesis_hook_404_title', 'thesis_404_title');

Default 404 Content
remove_action('thesis_hook_404_content', 'thesis_404_content');

Adversely, you can replace “remove_action” with “add_action” and type a new hook to move any of these Thesis Elements around on your skin. For example: if you wanted to move the Thesis Nav Menu from the top, down to the bottom of the Header:

First, remove the Nav from the hook, “Before Header”
remove_action('thesis_hook_before_header', 'thesis_nav_menu');

Now, add it back to the hook, “After Header”
add_action('thesis_hook_after_header', 'thesis_nav_menu');

The final syntax in custom_functions.php would look like this:

<?php
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_after_header', 'thesis_nav_menu');

You can get the full list of Hooks, Elements, and Actions at DIYThemes.com – then print off all the hooks with this handy visual reference: ThesisHooks.com

Related posts:

  1. Thesis Hooks = Module Positions
  2. How To: Get Featured Content Gallery to work in Thesis
  3. Thesis Theme: 3 Golden Rules
  4. How To: Use WordPress Conditional Tags In Thesis
  5. Thesis 1.8 Header Image

{ 12 comments… read them below or add one }

Karen August 21, 2010 at 23:14

Lots of places online have mentioned unchecking the RSS feed to remove it from the nav menu, but I want to relocate it. I have done so using the OpenHook plugin for Thesis, but I can get the text to transform to uppercase, but I cannot get the background RSS image to appear, nor can I increase the padding or margin around it through my custom css. Any idea what I might be doing wrong?

Thanks!

Reply

Adam June 22, 2010 at 06:09

Hey, how would I go about removing the RSS link on the navigation bar?

Thanks
Adam (www.adamhuxtable.com)

Reply

Greg Rickaby July 28, 2010 at 09:07

Thesis Options –> Navigation Menu. Uncheck “Show RSS Feed Link”

Reply

Alice February 27, 2010 at 08:54

Hi,

how would I go about removing the sidebars just from the pages (keep them everywhere else)?

Reply

Greg Rickaby February 27, 2010 at 09:00

By using the page template “No Sidebars”.

WP-Dashboard –> Pages –> Edit Page –> “No Sidebars” from the Page Template drop down underneath the “Publish” button.

Reply

Sushant January 29, 2010 at 12:37

Any hooks for sidebar. I need to hide sidebar from the home page.

Reply

Greg Rickaby February 10, 2010 at 12:04

Open custom.css and write:
.custom #sidebars { display:none}

Reply

John Munoz July 27, 2010 at 09:53

Greg,

I just spent the last 2 hours searching for the information you posted above. Thank you, thank you, thank you! Simple and effective.

Reply

Greg Rickaby July 28, 2010 at 07:15

You’re welcome. I come back to this post a lot.

Reply

gregrickaby November 27, 2009 at 17:46

It's much more of a framework than theme. Many people don't realize that until AFTER they've paid for it. It's a beast to learn, but if you're coming from the Hand Coding – then Thesis will come easy for you. Once you figure out Hooks & CSS you can pretty much make Thesis do what-ever-you-want!

Ever wonder why Chris Pearson calls his company, “DIY Themes”? “Do It Yourself” :)

Reply

gregrickaby November 27, 2009 at 11:46

It's much more of a framework than theme. Many people don't realize that until AFTER they've paid for it. It's a beast to learn, but if you're coming from the Hand Coding – then Thesis will come easy for you. Once you figure out Hooks & CSS you can pretty much make Thesis do what-ever-you-want!

Ever wonder why Chris Pearson calls his company, “DIY Themes”? “Do It Yourself” :)

Reply

atlantarealestate November 26, 2009 at 09:55

Nice list, much appreciated. I'm knee deep in Thesis at the moment. I come from the hand coding side of the world.

I find it sort of ironic that to make Thesis sing, you have to basically learn a API and to make it really sing, you need to become proficient at a scripting language that resembles SQL queries.

Not sure all that is easier than standard HTML + CSS + PHP, but apparently a lot of folks do and perhaps I will see the light.

RM

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: