• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Editing the 404 Error page in Fabric Theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Editing the 404 Error page in Fabric Theme

This topic is: not resolved

Tagged: 404 error page, fabric theme

  • This topic has 17 replies, 5 voices, and was last updated 9 years, 1 month ago by David Borrink.
Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • April 28, 2013 at 4:18 pm #38283
    Scott Milford
    Member

    How can I edit the 404 error page in the Fabric theme? I want to remove some of the items that are showing up.

    More specifically, the page shows the standard error message and is followed by a listing of Pages, Categories, Authors, Monthly, and Recent Posts. This a great thing, but it's showing even pages that I had hidden because they're not relevant except in specific situations. Such as when someone is going through the email sign-up process. So if someone stumbles upon a 404 error page, he/she doesn't need to see those and certain other pages. So I'd like to edit the listing so it only shows what's relevant.

    Thanks.

    http://behaviorandmotivation.com
    April 28, 2013 at 4:51 pm #38297
    AnitaC
    Keymaster

    You can use the Genesis 404 Page plugin which will allow you to customize/change it - http://wordpress.org/extend/plugins/genesis-404-page/.


    Need help with customization or troubleshooting? Reach out to me.

    April 29, 2013 at 6:01 pm #38479
    Scott Milford
    Member

    Anitac,

    The plugin looks fine. But I don't want to start from scratch. I'd really like to just edit what's already there. I don't know how to do that or even where to find the code/plugin/options/settings that cause the page to exist in the first place.

    Any ideas how I can edit that existing 404 page that came with the Fabric theme? Or maybe it came with Genesis, I'm not sure. 🙂

    Scott

    April 29, 2013 at 8:36 pm #38494
    AnitaC
    Keymaster

    Child themes do not come with a 404 page. You will need to create a custom 404 page or maybe follow the instructions found here - http://dreamwhisperdesigns.com/genesis-tutorials/customize-genesis-404-page/. If you modify the core 404 files in Genesis, they will be overwritten when the upgrade takes effect.


    Need help with customization or troubleshooting? Reach out to me.

    April 30, 2013 at 6:24 am #38544
    Brad Dalton
    Participant

    Hi Scott.

    Here's a custom 404 page template for Genesis which includes i'd's for posts and pages you want to exclude from displaying on your error page.

    Simply replace the 24,36 with your own page/post i.d's.

    Code not displaying? Grab it on Github.


    Tutorials for StudioPress Themes.

    April 30, 2013 at 2:18 pm #38623
    Scott Milford
    Member

    Anita & Brad,

    First, thanks for taking the time to help me. I really appreciate it! Seriously!

    Second, a 404 page already exists. It's not the one I created for my old theme. I don't know where it came from, but I assumed it was part of Genesis or Fabric theme. But if Fabric doesn't come with a 404 error page, it must be a part of Genesis.

    Anyway, I really like this 404 error page and want to keep it. Only I'd like to edit it just a little. I don't want to make a brand new 404 page but why redo it if I mostly like what's already there?

    So can you (or anyone) tell me how to find the source of this 404 page in Genesis so I can look for the parts that refer to the pages I'd like to not show up? I don't know if I'll find it or be able to edit the pages out, but I think I should be able to.

    Thanks!

    Scott

    April 30, 2013 at 2:25 pm #38625
    Scott Milford
    Member

    Okay....I found this:

    <?php
    /*
    WARNING: This file is part of the core Genesis framework. DO NOT edit
    this file under any circumstances. Please do all modifications
    in the form of a child theme.
    */

    /**
    * Handles display of 404 page.
    *
    * This file is a core Genesis file and should not be edited.
    *
    * @category Genesis
    * @package Templates
    * @author StudioPress
    * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
    * @link http://www.studiopress.com/themes/genesis
    */

    /** Remove default loop **/
    remove_action( 'genesis_loop', 'genesis_do_loop' );

    add_action( 'genesis_loop', 'genesis_404' );
    /**
    * This function outputs a 404 "Not Found" error message
    *
    * @since 1.6
    */
    function genesis_404() { ?>

    <div class="post hentry">

    <h1 class="entry-title"><?php _e( 'Not Found, Error 404', 'genesis' ); ?></h1>
    <div class="entry-content">
    <p><?php printf( __( '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 with the information below.', 'genesis' ), home_url() ); ?></p>

    <div class="archive-page">

    <h4><?php _e( 'Pages:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_list_pages( 'title_li=' ); ?>
    </ul>

    <h4><?php _e( 'Categories:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_list_categories( 'sort_column=name&title_li=' ); ?>
    </ul>

    </div><!-- end .archive-page-->

    <div class="archive-page">

    <h4><?php _e( 'Authors:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?>
    </ul>

    <h4><?php _e( 'Monthly:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_get_archives( 'type=monthly' ); ?>
    </ul>

    <h4><?php _e( 'Recent Posts:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_get_archives( 'type=postbypost&limit=100' ); ?>
    </ul>

    </div><!-- end .archive-page-->

    </div><!-- end .entry-content -->

    </div><!-- end .postclass -->

    <?php
    }

    genesis();

    I get the feeling that I can only remove the whole PAGE category, rather than individual pages within the PAGE category listing. So does anyone know if there's a way to prevent some pages from showing up in this listing?

    April 30, 2013 at 10:38 pm #38678
    Brad Dalton
    Participant

    The code I provided is exactly as you wanted.

    So does anyone know if there’s a way to prevent some pages from showing up in this listing?

    Its the Genesis 404 page which I have copied and added a new parameter for excluding page/post i.d's that you don't want displayed.


    Tutorials for StudioPress Themes.

    May 1, 2013 at 2:55 am #38708
    Scott Milford
    Member

    Brad,

    Oh...now I understand. Okay, so this is not my strength so I need to ask a few questions.

    So basically, I just copy the code and pasted it in  "404.php", replacing the text that's already there? This is the Genesis 404 Template...one of the core templates for Genesis. Is it okay to replace the text in that file?

    How do I determine the page/post ID for the pages I don't want displayed?

    Thanks for being patient with me, Brad. 🙂

    Scott

    May 1, 2013 at 3:52 am #38711
    Brad Dalton
    Participant

    There's a link at the start of code which explains what to do.

    I suggest you copy the code from the view raw link into a new file using Notepad++ and save it as a 404.php file.

    Then upload it to your child themes folder.

    Please DON'T touch the default 404.php file in the Genesis core. This new file will over ride it.

    Hover over the edit or delete links for each page/post you want to exclude from the 404 page and grab the i.d's which appear in the footer of your screen. Its all in the tutorial.

    Or install this plugin http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/


    Tutorials for StudioPress Themes.

    May 3, 2013 at 8:29 pm #39199
    Scott Milford
    Member

    Brad,

    Okay...so far so good. I have excluded the pages that I don't want showing. Now, I need to exclude one item (ID 51) from the category list. How would I do this? My code is below.

    Cheers!
    Scott

    ------
    <?php

    /**
    * Handles display of 404 page not found errors.
    *
    * Custom 404 page not found error template. Exclude Hidden Pages From 404 Page Not Found Error Page.
    *
    * @category Genesis
    * @package Templates
    * @author Brad Dalton
    * @link http://wpsites.net/web-design/add-content-404-page-genesis/
    */

    /** Remove default loop **/
    remove_action( 'genesis_loop', 'genesis_do_loop' );

    add_action( 'genesis_loop', 'genesis_404' );
    /**
    * This function outputs a 404 "Not Found" error message
    *
    * @since 1.6
    */
    function genesis_404() { ?>

    <div class="post hentry">

    <h1 class="entry-title"><?php _e( 'Whoops! We Can’t Find What You’re Looking For!', 'genesis' ); ?></h1>
    <div class="entry-content">
    <p><?php printf( __( 'It appears as if you entered in an invalid URL or maybe the Internet had a hiccup. It’s nothing to worry about. Sometimes the Internet has strange behavior. I’m guessing you’ve been hit by a strong motivation to consider your options. 🙂 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 with the information below.', 'genesis' ), home_url() ); ?></p>

    <div class="archive-page">

    <h4><?php _e( 'Pages:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_list_pages('exclude=1193,308,1441,113,139,1030,1051,1387,1059,3,77,205&title_li='); ?>
    </ul>

    <h4><?php _e( 'Categories:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_list_categories( 'sort_column=name&title_li=' ); ?>
    </ul>

    </div><!-- end .archive-page-->

    <div class="archive-page">

    <h4><?php _e( 'Authors:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?>
    </ul>

    <h4><?php _e( 'Recent Posts:', 'genesis' ); ?></h4>
    <ul>
    <?php wp_get_archives( 'type=postbypost&limit=100' ); ?>
    </ul>

    </div><!-- end .archive-page-->

    </div><!-- end .entry-content -->

    </div><!-- end .postclass -->

    <?php
    }

    genesis();
    ------

    May 4, 2013 at 1:09 am #39220
    Brad Dalton
    Participant

    Good stuff Scott. Please use Pastebin or Github Gists when pasting code here. You can also use shortcodes which you can read more about in the FAQ No.5

    So you want to exclude all posts from a category or the category itself?


    Tutorials for StudioPress Themes.

    May 4, 2013 at 11:06 am #39276
    Scott Milford
    Member

    Brad,

    Before this recent conversation, I didn't know what a "Github Gists" was and the same goes for "Pastebin". So I'll see if I can figure out how to use them. I'm sure it's probably not complex, but I haven't tried to convert any code into numbered lists before such as you do when you paste code.

    There's one item showing up in the category list that I'd like to exclude. The ID number for that item is 51.

    Scott

    May 5, 2013 at 1:34 am #39322
    Brad Dalton
    Participant

    One item? Do you mean one post? If so, find the i.d for that post and add it to the other i.d's in the code.


    Tutorials for StudioPress Themes.

    May 5, 2013 at 2:26 pm #39439
    Scott Milford
    Member

    I don't know if I'm explaining it properly. But as it turns out, the issue somehow fixed itself. Not sure why. But thanks for your help, Brad!! 🙂 You've been a big help and I finally was able to switch over and make the redesigned version of my blog live. 🙂

    May 5, 2013 at 2:37 pm #39442
    Brad Dalton
    Participant

    No worries Scott.


    Tutorials for StudioPress Themes.

    October 6, 2013 at 12:25 pm #65574
    stepheniryna
    Member

    Brad,

    There I was, after creating a custom sitemap (page_archive.php) template. Had excluded categories, author, months, and recent; I only needed pages. Then all I needed to do was exclude a few pages, and Google brought me here (after a few other misses).

    Your solution worked great in about 30 seconds.

    Thanks.

    I only wish there was a way to change the order or the list. My pages don't really make sense in alphabetical order.

    January 2, 2017 at 7:02 pm #198651
    David Borrink
    Participant

    Brad, thanks for posting your 404.php example. I used it and brought the search form coding back in from the default 404.php file. Works great!

    Scott, thanks for posting this topic. My situation was to eliminate the pages, authors, and monthly listings, leaving the rest as-is.

  • Author
    Posts
Viewing 18 posts - 1 through 18 (of 18 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble