Thesis is one of the most popular WordPress theme frameworks used by bloggers and webmasters. Each and every part of thesis can be easily customized using thesis hooks. Here is an excellent tutorial that helps to customize the 404 error page in your thesis theme. It is advised to have a custom 404 error page, so that first time visitors will turn into regular readers of your blog.

Now, coming to the code part, entire 404 page can be controlled using thesis theme hooks. As you are experimenting on theme files, it is advised to back up your theme.
You need to edit this file in custom folder of Thesis Theme
custom_functions.php
Also Read : 5 Reasons why we choose Genesis over Thesis
Adding a title to 404 Error Page in Thesis Theme
You need a title to let your readers know, that the page they are trying to access is not available. To do that, simply add the below code to custom_functions.php and save it.
function custom_thesis_404_title() {
?>
<h2>Bad Luck! Cant find the page you are looking for ?</h2>
<?php
}
remove_action('thesis_hook_404_title', 'thesis_404_title');
add_action('thesis_hook_404_title', 'custom_thesis_404_title');
Functionality of this code :
- It will remove the default 404 title and add a custom 404 title.
- Replace the heading between <h2> and </h2> tags with the one you like.
- Now, lets move-on to the content part of 404 page.
Read this : How to Login to WordPress using Email Address
Adding content to 404 Error page in Thesis Theme
The best way to craft a 404 error page is by adding latest articles to it. Now, include the below code in custom_functions.php and save it.
function custom_thesis_404_content() {
?>
<p>Try your luck by checking these recent articles</p>
<ul>
<?php
global $post;
$args = array( 'numberposts' => 10,'order'=> 'DESC','orderby'=> 'post_date');
$postslist = get_posts( $args );
foreach($postslist as $post) : setup_postdata($post); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<?php
}
remove_action('thesis_hook_404_content', 'thesis_404_content');
add_action('thesis_hook_404_content', 'custom_thesis_404_content');
Functionality of this code :
- It will remove the default 404 content and add a custom 404 content.
- You can also define number of posts by changing the value in
‘numberposts’ =>10.
Also Check : How to add 3 column footer to WordPress theme
You are done with customizing 404 error page in thesis theme, we also design awesome child skins for thesis theme, Please contact us to get a quote. Meanwhile Subscribe to our feeds, to receive awesome tutorials like this.
Please drop a comment, if you need any help regarding this article.


How to Change Background Color of Posts in WordPress Admin
How to Effectively Interlink Blog Posts in WordPress
How to Add Dummy Content in WordPress Development Site
How to Add nofollow to WordPress Menu Links
How to Leverage Browser Caching on WordPress Blog
How to Add Google Plus Share Button in WordPress
i think this line has some issue. i am having issue in this line. Someone have a word on this…
Issues fixed and its working fine now. Thank you.
I’ve been looking for this tip everywhere. Thanks to this code, I now have 1 less plugin installed.
Thanks!!