Thematic WordPress Theme Toolbox: 10 extremely useful hooks

Do you like WordPress Theme Frameworks? To be honest, I'm a Thematic addict. Using this theme, I'm able to create any kind of site extremely fast. To help you getting started with Thematic child theme development, I have compiled 10 useful WordPress hooks in this article.

If you’re looking for a tutorial on how to create a Thematic child theme, you should read this post.

Add a favicon

A favicon is a small image displayed by modern web browsers. It is a must have for all websites, because it allows your visitors to quickly visualize your site among others when they have lots of browser tabs open at the same time.
This handy code will add your favicon to your theme. Make sure a favicon.png file is in your child theme images directory, and then paste the code in your functions.php file:

function childtheme_favicon() { ?>
	<link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.png" />
<?php }
add_action('wp_head', 'childtheme_favicon');


Add an Internet Explorer specific stylesheet

Who doesn’t hate Internet Explorer? Unfortunately, most clients will require developers to make their site IE-compliant. And the best way to do so is to use some conditional comments and a dedicated stylesheet.
Create a file named ie.css in your child theme directory, and then insert the following code in your functions.php file:

function childtheme_ie_style() { ?>
	<!--[if IE]>
		<link rel="stylesheet" type="text/css" href="" />
<?php }
add_action('wp_head', 'childtheme_ie_style');

Modify Doctype

By default, Thematic outputs a XHTML 1.0 transitional doctype. If for some reason, you prefer using another kind of doctype, pasting the code below in your functions.php will do the trick.

function childtheme_create_doctype($content) {
 $content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">';
 $content .= "\n";
 $content .= '<html xmlns=""';
 return $content;
add_filter('thematic_create_doctype', 'childtheme_create_doctype');

Use Feedburner RSS feeds

Feedburner is very popular among bloggers. If you want to replace default rss feeds by feedburner feeds in Thematic, this code is for you.

function childtheme_rssfeeds($content) {
	$content = "\t";
	$content .= "<link rel=\"alternate\" type=\"application/rss+xml\" href=\"";
	$content .= "";
	$content .= "\" title=\"";
	$content .= wp_specialchars(get_bloginfo('name'), 1);
	$content .= " " . __('RSS feed', 'thematic');
	$content .= "\" />";
	$content .= "\n";
	return $content;
add_filter('thematic_rss', 'childtheme_rssfeeds');

Add Google Analytics code to your Thematic child theme

Google Analytics is another free and very useful service. In order to allow GA to collect your visitor information and create your stats, you have to insert a small piece of Javascript on your footer.php file.
Insert this code in your functions.php file, save it, and you’re done. Of course, don’t forget to replace the Google Analytics code with your own!

function ga(){ ?>
	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E"));
	<script type="text/javascript">
	try {
	var pageTracker = _gat._getTracker("UA-XXXXX-10");
	} catch(err) {}</script>
<?php }
add_action('wp_footer', 'ga');

Modify Thematic footer credit

If you’re building a Thematic child theme for a client, you may want to insert your credit link in the footer text. The following code will do it. Don’t forget to give credit to Ian Stewart for his awesome work on the Thematic theme framework!

function my_footer($thm_footertext) {
	$thm_footertext = 'Copyright &copy; 2010 Jean-Baptiste Jung. <a href=""></a> is obviously powered by <a href="">WordPress</a> &amp; the <a href="">Thematic Theme framework</a>.';
	return $thm_footertext;
add_filter('thematic_footertext', 'my_footer');

Display Thematic menu above header

Want to have your navigation menu above your site header? That’s not a problem. This code will remove the menu from below the header and then put it above it.

function remove_thematic_actions() {

Change “more” link text

Thematic “Read More” link displays Read More » by default. The following code allow you to change the “Read More” text.

function childtheme_more_text($content) {
	$content = 'Click to read the rest!';
	return $content;
add_filter('more_text', 'childtheme_more_text');

Change gravatar size in Thematic comments

By default, Thematic displays 35px*35px gravatars. If you want to change this size, no problem: Just paste this code in, as usual, your beloved functions.php file.

function childtheme_avatarsize() {
    return '56';
add_action( 'avatar_size', 'childtheme_avatarsize' );


Remove Thematic menu on specific page template

If you want to make a squeeze page on your site or blog using Thematic, that’s quite easy: You only have to create a page template and remove the menu. To do so, just paste the code below in your functions.php file.
Don’t forget to set your page template name on line 2.

function remove_access() {
    if (is_page_template('affiliate.php')) {



By the way, if you’re interested in Thematic Theme help, don’t hesitate to ask me. I just started freelancing and I’m ready to help you for a reasonable price.

  • You nailed it! Why recreate it AGAIN. Ya, we need to innovate, but there are just some things that are so basic, that, well, they’re basic. So let’s innovate off of them!

  • Great collection of hooks. IE-specific css and removing menu on specific page are especially useful. Thanks for sharing!

  • Thanks for the post I really need to know this. It’s very informative.

  • Tim

    I’ll favorite this, very handy to use as a reference!

  • Only half of those were specific to Thematic (doctype, feedburner, footer credit, menu above header, and remove menu for specific page), but still a handy list of tips for many people.

  • Another Thematic addict here! I really find it faster to work on websites using Thematic. Thanks for these hooks, they’re gonna make my life a lot easier.

  • Pingback: Quelques trucs pour Wordpress (2 &3) « Trois Point Zéro – Actualité, ressources, tutoriels autour du webdesign et du développement web en général()

  • Cats Who Code strikes again! I am a Thematic junkie, too!

  • Distinctive and useful article I put in my favorites

  • Great hooks! Got to check them out. Thanks for sharing!

  • solid work. I’m using a few of these on my upcoming blog

  • Cool stuff! WordPress created big questions for me since I first used it. Thanks for enlightening.

  • Great article Jean, gonna try these out in a couple of days.

    Although I enjoy coding themes 😉 want to give thematic a go for once


  • Not tried Thematic yet but have been well impressed with Thesis and Atahualpa (if that’s how you spell it..) so will give it a go! Theme frameworks have let me extend WordPress beyond what I thought was possible and also deploy sites much quicker than hand coding.


  • Nice article..Very informative Many thanks!!

  • I just bookmark your link, thanks for sharing this

  • Always great help from you buddy. Amazing articles and very clean coding and explanation. All those mods are extremely useful and can bring personality to wordpress.

  • Hi , awesome tips, will be using the favicon , move the menu above header and , read more text someday. Is there any difference if people use the feedburner feed or my default rss feed ? I also use feedburner

  • The hook to move the navigation above the header is incorrect.

    The third line should be changed from




    Great list!

  • It’s very informative.

  • New thematic user here… 😉

    I got a question for you jean. Wich one better, thematic default IE class, or specific conditional comment like you wrote above?

    thanks before.

  • Great hooks – very informative. You nailed it again! Thanks for sharing.

  • Thank you very much for your hints. I am using thematic since a while and made some child themes. But, nevertheless your hints have been extremely helpful.
    Good work Jean-Baptiste!!