How to customize 404 error page?
Where can I add additional text/js to the 404 error page?
|
There isn't a custom 404 error page in this theme. This is actually pretty common.It would be best to make a donation and then a request to Flynn to add it to the list for the next rev - since atahualpa uses a single file for all page handling.
If you don't mind hacking the theme, you can edit the index.php file and go to the end and change the 'NOT found' text to whatever you want. |
I want to show my index.php for my 404 page. I have a site summary there, so somebody might find something relevant. So, I don't need a custom 404. So, how do you make the index.php so it can be used as a 404?
Thank you, X |
I beleive you just make a copy and name it 404.php
|
I opened the index.php, saved as to 404.php, and added this line in the .htaccess:
ErrorDocument 404 /404.php This is what happened: Warning: include(TEMPLATEPATH/functions/bfa_get_options.php) [function.include]: failed to open stream: No such file or directory in /home/content/14/5765714/html/404.php on line 2 Warning: include() [function.include]: Failed opening 'TEMPLATEPATH/functions/bfa_get_options.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/14/5765714/html/404.php on line 2 Fatal error: Call to undefined function get_header() in /home/content/14/5765714/html/404.php on line 3 Help. X Edited to add: I went to permalinks and switched to another setting and switched back and now I don't get that error message. But, when I put in a page title that is not in my blog I get the original 404 message: Not Found Sorry, but you are looking for something that isn't here. I don't get mine. Where should I put the 404.php? Should it be in the same place the index.php is or in the root? Thank you, X |
1) did you copy the Atahualpa index.php?
2) it must be in the atahualpa folder |
I used this file:
\wp-content\themes\atahualpa\index.php Do I keep the 404.php in that folder or in the root? Do I list it in the .htaccess? I previously had an html website in my domain where wordpress is now. I don't know what things are different and what are the same for using WordPress. Previously, I had my custom 404 in the root. Thank you, X |
TAKE A LOOK AT http://forum.bytesforall.com/showthr...ght=custom+404
|
It does not say where the 404.php goes: same as the index.php or in the root. X
|
re read post #6 item (2)
|
Oops. Sorry.
Thank you, X |
What file comes up with this text:
Not Found Sorry, but you are looking for something that isn't here. Can I just replace that text with mine? X |
it's displayed by the code in index.php
HTML Code:
<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page. |
Thank you,
X |
I started a second blog today, with Atahualpa, of course. There is a 404 template in it, and I sure could not find one before. Did you add one in the past few days?
Just curious. X |
nope. no theme provided 404.php - may be something your host sitcks in
|
Ok, Thank you!
X |
@Juggledad, I added a 404.php today following another post where you instructed someone to do so.
I tried the edit in the index.php but that didn't work. I think it had something to do with what my home page where blog posts go is called. So now my error 404 page comes up like this http://vivbounty.net/this-page-not-here which is a standard edit from 2013 theme. No redirect, just search and not at all inspiring. I would like to customize it to lead back to my static page, perhaps like this (at the very least): "Oops, I screwed up and you discovered my fatal flaw. Well, we're not all perfect, but we try. Can you try this again or maybe visit our <a title="Our Site" href="http://example.com/index.php">Home Page</a> to start fresh. We'll do better next time." The wording above is copied from another tutorial, and not words I would use, but you get the idea. So I tried visit our <a title="Home" href="http://vivbounty.net/index.php">Home Page</a> to start fresh. We'll do better next time." which returned a blank page. Just nothing. The edit to the index you suggested in the other thread I read also returned a blank page. Can you help? Thanks in advance for any light you can shed on this for me. Cheers, Viv |
Add teh following to a TEXT file and save it as 404.php - customize it as you want
HTML Code:
<?php |
So I did this and got that blank page again.
Does it have something to do with ' vs " when adding custom text? Code:
<?php |
You have a bug in your code that is throwing a
HTML Code:
Parse error: parse error in.../wp-content/themes/atahualpa/404.php on line 19 HTML Code:
_e( 'Maybe try a search?', ); HTML Code:
_e( 'Maybe try a search?', '' ); |
Thanks so much, that did it!
I will experiment with https://codex.wordpress.org/Function_Reference/_e and learn some more. Thanks again. Have a wonderful evening. |
All times are GMT -6. The time now is 04:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.