Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   How to customize 404 error page? (http://forum.bytesforall.com/showthread.php?t=890)

wfzimmerman Mar 20, 2009 03:21 PM

How to customize 404 error page?
 
Where can I add additional text/js to the 404 error page?

owenl Mar 20, 2009 04:24 PM

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.

X-Evolutionist Mar 4, 2010 09:55 PM

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

juggledad Mar 5, 2010 06:18 AM

I beleive you just make a copy and name it 404.php

X-Evolutionist Mar 5, 2010 08:49 AM

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

juggledad Mar 5, 2010 10:01 AM

1) did you copy the Atahualpa index.php?
2) it must be in the atahualpa folder

X-Evolutionist Mar 5, 2010 10:20 AM

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

juggledad Mar 5, 2010 11:17 AM

TAKE A LOOK AT http://forum.bytesforall.com/showthr...ght=custom+404

X-Evolutionist Mar 5, 2010 11:52 AM

It does not say where the 404.php goes: same as the index.php or in the root. X

juggledad Mar 5, 2010 12:00 PM

re read post #6 item (2)

X-Evolutionist Mar 5, 2010 12:12 PM

Oops. Sorry.

Thank you,

X

X-Evolutionist Mar 5, 2010 12:19 PM

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

juggledad Mar 5, 2010 12:45 PM

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

X-Evolutionist Mar 5, 2010 01:01 PM

Thank you,

X

X-Evolutionist Mar 5, 2010 05:54 PM

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

juggledad Mar 7, 2010 07:50 AM

nope. no theme provided 404.php - may be something your host sitcks in

X-Evolutionist Mar 7, 2010 08:11 AM

Ok, Thank you!

X

VivBounty Oct 2, 2016 06:10 PM

@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

juggledad Oct 2, 2016 06:20 PM

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

VivBounty Oct 2, 2016 06:43 PM

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(); ?>


juggledad Oct 2, 2016 06:56 PM

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?', '' );

VivBounty Oct 2, 2016 07:50 PM

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 01:30 AM.

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