Quantcast
Channel: Crunchify
Viewing all articles
Browse latest Browse all 1037

How to modify 404 Page Not Found template for WordPress Genesis Framework Theme?

$
0
0

Modify 404 page for WordPress Genesis Framework

Are you running your site on Genesis WordPress Framework and would like to change 404 Page template? Well, you are at right place.

On Crunchify we do use Genesis Framework. By default child theme doesn’t come with 404.php file. You don’t need to use any plugin to modify 404 page. I personally against using more plugins on site as it may increase your page load time which is definitely a bad indication for Google SERP result. Do you have below questions?

  • Creating a Custom 404 Page with Genesis
  • Genesis 404 Page?
  • More Ways To Customize Your 404 Page
  • Customize the Genesis 404 Page
  • Best WordPress 404 plugin?
  • Genesis Child theme 404 page template

Here are the simple steps by which you could modify 404 template as per your need very quickly.

Let’s get started:

Step-1

Copy 404.php file from /wp-content/themes/genesis folder and put it in yours child theme.

Genesis Framework - 404.php file location

Step-2

  • Go to Admin Panel
  • Click on Appearance
  • Choose Editor
  • You should now see 404.php under right panel

Modify 404.php from Admin Panel - Crunchify Tips

Step-3

Based on your need you have to modify 404.php file. Here is what I’ve done.

Here is a code which I use on Crunchify:

<?php

remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'genesis_404');

function genesis_404()
{
    echo genesis_html5() ? '<article class="entry">' : '<div class="post hentry">';
    printf('<h1 class="entry-title">%s</h1>', apply_filters('genesis_404_entry_title', __('Not found, error 404', 'genesis')));
    echo '<div class="entry-content">';
    echo apply_filters('genesis_404_entry_content', '<p>' . sprintf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it by using the search form below.', 'genesis') , trailingslashit(home_url())) . '</p>');
?>

<h4><?php
    _e('Search more than 700 tutorials:', 'genesis'); ?></h4>

<form action="http://crunchify.com/search/" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-4032710958875645:9846869911" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" class="crunchify-search" name="q" size="55" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>

<div class="archive-page">
<br />
<h4><?php
    _e('OR - You might like reading these recent posts:', 'genesis'); ?></h4>
<ul>
<?php
    wp_get_archives('type=postbypost&limit=50'); ?>
</ul>

</div><!-- end .archive-page-->
<?php
}

genesis();

Just update your search box code and you will see nice 404 page now with your custom template. There are hundreds of different ways you could modify 404 page. Share your hosted innovative 404 page URL once you have it so other readers could get some more ideas.

Try going to page http://crunchify.com/404-test to see it live.

Have a suggestion or anything to add to this article? Chime in and share as a comment OR post it in forum.

The post How to modify 404 Page Not Found template for WordPress Genesis Framework Theme? appeared first on Crunchify.
Author: App Shah


Viewing all articles
Browse latest Browse all 1037

Trending Articles