Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

How to customize 404 error page?


  #1  
Old Mar 20, 2009, 03:21 PM
wfzimmerman
 
3 posts · Mar 2009
Where can I add additional text/js to the 404 error page?
  #2  
Old Mar 20, 2009, 04:24 PM
owenl
 
44 posts · Jan 2009
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.
  #3  
Old Mar 4, 2010, 09:55 PM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
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
  #4  
Old Mar 5, 2010, 06:18 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I beleive you just make a copy and name it 404.php
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Mar 5, 2010, 08:49 AM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
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

Last edited by X-Evolutionist; Mar 5, 2010 at 08:54 AM. Reason: Added "edited to add" info
  #6  
Old Mar 5, 2010, 10:01 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
1) did you copy the Atahualpa index.php?
2) it must be in the atahualpa folder
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Mar 5, 2010 at 12:00 PM.
  #7  
Old Mar 5, 2010, 10:20 AM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
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
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #8  
Old Mar 5, 2010, 11:17 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
TAKE A LOOK AT http://forum.bytesforall.com/showthr...ght=custom+404
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Mar 5, 2010, 11:52 AM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
It does not say where the 404.php goes: same as the index.php or in the root. X
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #10  
Old Mar 5, 2010, 12:00 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
re read post #6 item (2)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Mar 5, 2010, 12:12 PM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
Oops. Sorry.

Thank you,

X
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #12  
Old Mar 5, 2010, 12:19 PM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
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
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #13  
Old Mar 5, 2010, 12:45 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>
the actual text is in bfa_theme_options.php
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #14  
Old Mar 5, 2010, 01:01 PM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
Thank you,

X
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #15  
Old Mar 5, 2010, 05:54 PM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
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
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #16  
Old Mar 7, 2010, 07:50 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
nope. no theme provided 404.php - may be something your host sitcks in
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #17  
Old Mar 7, 2010, 08:11 AM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
Ok, Thank you!

X
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/
  #18  
Old Oct 2, 2016, 06:10 PM
VivBounty
 
51 posts · Jun 2012
Canadian Maritimes
@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
  #19  
Old Oct 2, 2016, 06:20 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Add teh following to a TEXT file and save it as 404.php - customize it as you want
HTML Code:
<?php 
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
get_header(); 
extract($bfa_ata); 
global $bfa_ata_postcount;
?>

<?php
//=================================
//            put your customizations AFTER this
//================================= ?>

"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."

<?php
//=================================
//            put your customizations BEFORE this
//================================= ?>
<?php get_footer(); ?>
Then put the file into the wp-content/themes/atahualpa folder
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #20  
Old Oct 2, 2016, 06:43 PM
VivBounty
 
51 posts · Jun 2012
Canadian Maritimes
So I did this and got that blank page again.
Does it have something to do with ' vs " when adding custom text?


Code:
<?php 
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
get_header(); 
extract($bfa_ata); 
global $bfa_ata_postcount;
?>

<?php
//=================================
//            put your customizations AFTER this
//================================= ?>

"Oh dear, it looks like we misplaced a page. 
So sorry about that. Can you try this
again or maybe visit our <a 
title="Home" href="http://vivbounty.net/index.php">Home 
Page</a> to start fresh. We'll do better next time."

<p><?php _e( 'Maybe try a search?',  ); ?></p>

					<?php get_search_form(); ?>

<?php
//=================================
//            put your customizations BEFORE this
//================================= ?>
<?php get_footer(); ?>
  #21  
Old Oct 2, 2016, 06:56 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
In the
HTML Code:
_e( 'Maybe try a search?',  );
If you are not going to specify the domain to retrieve the translated text, you need the line to be
HTML Code:
_e( 'Maybe try a search?', '' );
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #22  
Old Oct 2, 2016, 07:50 PM
VivBounty
 
51 posts · Jun 2012
Canadian Maritimes
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.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
custom 404: Dunstan-style Error Page Plugin twincascos Plugins & Atahualpa 3 Dec 20, 2010 09:26 AM
404 error when reader submits comment beanfair Comments, trackbacks & pings 4 May 7, 2010 05:45 AM
[SOLVED] Permalink or 404 error - page not displaying correctly woolef Atahualpa 3 Wordpress theme 19 Apr 4, 2010 03:08 PM
404 error seneque Atahualpa 3 Wordpress theme 1 Apr 11, 2009 11:20 PM
[SOLVED] 404 error with wp-print and wp-email Alexi Plugins & Atahualpa 8 Dec 28, 2008 01:38 AM


All times are GMT -6. The time now is 12:35 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.