• 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

Featured Image issues on 404.php

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 › General Discussion › Featured Image issues on 404.php

This topic is: not resolved

Tagged: 404.php, featured image, is_404

  • This topic has 8 replies, 2 voices, and was last updated 9 years, 10 months ago by Brad Dalton.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • August 15, 2016 at 6:24 am #191288
    MooseintheUK
    Member

    So im currently adapting the genesis 404.php file [not the parent file of course], but ive run into an issue with the featured image. Its pulling in the blog pages feature which i dont want. Now usually i would change this by calling on the page id from the body class if the page doesnt have a wordpress page, but the 404 page doesnt get a page-id-#. I tried using the .error404 class, but to no this has not worked.

    Anyone have a solution to this? Much appreciated if you do.

    August 15, 2016 at 6:59 am #191289
    Brad Dalton
    Participant

    You can remove the featured image from the 404.php file.


    Tutorials for StudioPress Themes.

    August 15, 2016 at 7:26 am #191292
    MooseintheUK
    Member

    Alas, i dont want to remove it. Well, my boss doesnt want me to remove it.

    August 15, 2016 at 7:38 am #191293
    Brad Dalton
    Participant

    What does this mean?

    Its pulling in the blog pages feature


    Tutorials for StudioPress Themes.

    August 15, 2016 at 8:05 am #191295
    MooseintheUK
    Member

    Ummmm, the featured image... The 404.php page is using the same featured image as the blog page.

    August 16, 2016 at 2:49 am #191363
    MooseintheUK
    Member

    for example, since for some reason i cant set the featured image from the wordpress page itself, im using this loop:

    <?php
    if (is_home()) {
    ?>


    [image tag]

    <?php

    }
    else {
    echo the_post_thumbnail('post-image');
    }
    ?>

    but its displaying the above image on the 404 page as well. Last time i checked, is_home doesnt apply to anything other than the blog page.

    August 16, 2016 at 2:55 am #191365
    Brad Dalton
    Participant

    It's not clear what you need help with.


    Tutorials for StudioPress Themes.

    August 16, 2016 at 3:19 am #191367
    MooseintheUK
    Member

    1) the featured image on the 404 page is the SAME as the BLOG page.
    2) according to the code this should NOT be happening. [see above comment for code]
    3) Usually in similar situations i would use the page-id-# to do this, BUT the 404 page DOESN'T have a page-id-#, instead it has the class of .error404 which doesn't work. EG:
    eg: // this works if page has an id-#
    <?php if ( is_page( '#' ) ) { ?>

    // so i tried this
    <?php if ( is_error404()) { ?>

    // & this
    <?php if ( is_page( 'error404' ) ) { ?>

    // neither works, so you cant use that class like you can front_page or home.

    4) I DO NOT want to remove the featured image from the 404 page COMPLETELY.
    5) I want to change the featured image on the 404 page to its own image, preferably being able to incorporate it into my existing code for featured images to keep things tidy.

    I literally cant spell it out any plainer than that.

    August 16, 2016 at 3:45 am #191368
    Brad Dalton
    Participant

    Try

    is_404()

    https://codex.wordpress.org/Conditional_Tags#A_404_Not_Found_Page


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘General Discussion’ 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