A Custom Thesis Theme 404 Page Which Is More User-friendly

A 404 page is basically an error page which shows up when the web-page you are trying to access is not found. Some pages go missing for various reasons — maybe the user navigated through a broken link or may be the page no longer exists. While the 404 page shows the visitor that the page they were looking for doesn’t exist, here’s a tip to make it more user-friendly. What would you want the users to do when they hit a 404 error page? A good idea is to place a search box on the 404 page so that the users can type in the search terms for the page they were looking for and see if they can get it in the search results. Here’s how you can do that.

Place the below code into the custom_functions.php file. This function will introduce a search box in the 404 page providing an opportunity for your blog visitors to search for the content.

function search404()
{ 
    ?>
    <p>You can use this search box to look for the missing page &mdash;</p> 
    <form method="get" action="https://www.converticacommerce.com/">
    <p> 
        <input type="text" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /> 
        <input type="hidden" id="searchsubmit" value="Search" />
    </p> 
    </form> 
    <?php 
} 

add_action('thesis_hook_404_content', 'search404', '11');

Think over and you can present more content for your users to browse through like the most popular posts etc. Thesis is a very powerful and effective premium WordPress theme. You can buy it from DIYTHEMES for $87 or get it free with one of our WordPress blog design services.

Posted In:

WordPress Support & Maintenance, Code Snippets, Thesis WordPress Theme Framework

Comment on A Custom Thesis Theme 404 Page Which Is More User-friendly

Your email address will not be published. Required fields are marked *