Aweber - Email Marketing Made Easy
Create a Custom Error 404 “Page Not Found” Page in Thesis

Create a Custom Error 404 “Page Not Found” Page in Thesis

March 13, 2011 · 1 comment

in Thesis

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

This Site Runs on the Thesis WordPress Theme

Thesis Theme thumbnail

If you're someone who doesn't understand a lot of PHP, HTML, or CSS, Thesis will give you a ton of functionality without having to alter any code. For the advanced user, Thesis has incredible customization possibilities via extensive hooks and filters. And with so many design options, you can use the template over and over and never have it look like the same site.

If you're more familiar with how websites work, you can use the fantastic Thesis User's Guide and world-class support forums to make more professional customizations than you ever thought possible. The theme is not only highly customizable, but it allows me to build sites with a much more targeted focus on monetization than ever before. You can find out more about Thesis below:

{ 1 comment… read it below or add one }

Kulwant Nagi October 28, 2011 at 9:25 am

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

Reply

Leave a Comment

When commenting, you can use basic HTML tags. If you are pasting in any code, please escape it here and then include that code within <pre></pre> tags. Thanks!

CommentLuv badge

Previous post:

Next post: