I think we’ve all seen the standard Thesis 404 error page with the familiar message, “You 404’d it. Gnarly, dude.” Even though Thesis takes care of creating this error page so that it falls in line with your overall design, what if you want to change the message or even update the design of the page?
Well, here’s a quick and easy way to create a custom 404 error page in Thesis. I’ve found that this page is often the most overlooked when it comes to customizing your Thesis site.
How to Customize the 404 Page Not Found Error Page in Thesis
It’s all comes down to the fantastic system of Thesis hooks. There are two specific hooks that allow us to control the Thesis 404 error page. These are:
- thesis_hook_404_content
- thesis_hook_404_title
Paste the following code in your custom-functions.php file:
/* Custom 404 Page */
function custom_thesis_404_title() {
?>
Your custom 404 error page title goes here
<?
}
remove_action(’thesis_hook_404_title’, ’thesis_404_title’);
add_action(’thesis_hook_404_title’, ’custom_thesis_404_title’);
function custom_thesis_404_content() {
?>
<p>Your custom 404 error page content goes here</p>
<?
}
remove_action(’thesis_hook_404_content’, ’thesis_404_content’);
add_action(’thesis_hook_404_content’, ’custom_thesis_404_content’);
The above two functions are simply replacing the default 404 page Title and Content with your own custom title and content. With Thesis hooks, not only can you add something to an existing hook, but you can also remove an existing hook, as is the case here.
What’s great about simple tutorials like this is that not only do you get to learn how to solve a specific problem, but as a consequence of it, you also learn more about Thesis hooks.
Now that you have created your custom 404 error page in Thesis, you can also style it however you want using your custom.css file. Let us know how this worked out for you in the comments, or share your own customized 404 error page in Thesis.
Source: Customizing the 404 Page
Was this post helpful? Consider subscribing to my blog via RSS or








































{ 1 comment… read it below or add one }
The biggest tips to improve SEO.. because google rank those pages only which don’t have any 404 Error..
Kulwant Nagi recently posted..Another Version of Blogging to Bring a Lots of Traffic on your blog