• I put a 404.php in my theme folder but it’s not being called. I juts get my index page with this text:

    Not Found
    Sorry, but you are looking for something that isn’t here.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator James Huff

    (@macmanx)

    Have you set the 404.php file as your custom 404 error page via .htaccess?

    If not, access the .htaccess file in your site’s main directory and enter the following (adjust the path to fit your installation):

    ErrorDocument 404 /wordpress/index.php?error=404

    My theme has a 404.php file, and I put ErrorDocument 404 /wordpress/index.php?error=404 in my .htaccess file. On both my live server and the local one it calls the 404 page, but without any of the styles.

    What am I doing wrong?

    At the top of your 404.php file, you’re missing a call to <?php get_header(); ?>

    That’s the first line of my 404.php file, and my Google Ads show up so it’s calling the header at that point, at least.

    Anything else?

    From what I can tell, it’s a problem with one of the other theme files. I based my theme off the Connections theme from the themes directory, and the 404 page doesn’t seem to work for that theme either.

    I’ve no problem fixing the theme, I just need to know where to look for a problem like this.

    Edit: I’ve replaced the files one-by-one and my header.php file seems to be the culprit. I’m trying to find out why.

    My header.php for kathy.deanomac.com contains the following code: <div id="header">
    <ul id="topnav">
    <script type="text/javascript">GOOGLE ADS HERE
    </script> </a></li>
    </ul>
    <h1><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
    <div id="desc"><?php bloginfo('description');?></div>
    </div>
    .

    For deanomac.com it says: <div id="header">
    <h1><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
    <div id="desc"><?php bloginfo('description');?></div>
    </div>
    .

    Neither of them work with the 404 page. It does work for the default theme, which has a significantly more complicated header.php file. Is there something I need to add to mine to make the 404 page accept it?

    Okay, I’ve tested that as well and it makes no difference. The error page displays the header content, so it’s not that either.

    Basically, it’s not recognizing the stylesheet. What would cause that?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP 1.5: 404.php not being called’ is closed to new replies.