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)
-   -   [SOLVED] Custom 404 page (http://forum.bytesforall.com/showthread.php?t=16954)

cajunman4life Mar 7, 2012 08:07 PM

[SOLVED] Custom 404 page
 
Hi, I searched this site for a while and could come up with nothing. Forgive me if it's already been answered, point me in the right direction and I'll be happy to read :)

I want to build a custom 404 page for use on my site with this theme, but have no idea how to go about it. This theme is crazy complex for me!

I greatly appreciate any assistance you can offer. Thanks!

lmilesw Mar 7, 2012 08:25 PM

One thing you could build off of is the 404.php file that is in the Twenty Eleven theme folder. Just put a copy in the Atahualpa Theme folder and you will have a new 404 page with a search box. You could then go ahead and style as you like.

cajunman4life Mar 8, 2012 09:52 AM

Quote:

Originally Posted by lmilesw (Post 81440)
One thing you could build off of is the 404.php file that is in the Twenty Eleven theme folder. Just put a copy in the Atahualpa Theme folder and you will have a new 404 page with a search box. You could then go ahead and style as you like.

Thank you very much! I thought about doing something like this but didn't fully know the ramifications of pulling a file out of another theme. I'll play around with it a bit today.

lmilesw Mar 8, 2012 10:20 AM

I didn't know either when I first tried it. Sometimes it's a matter of just "giving it a shot". Worse case scenario for this situation is you would have to delete the 404.php file.

Let us know how it works out for you.

cajunman4life Mar 8, 2012 06:27 PM

So, I did that, and the resulting 404 page was hopelessly borked.

Luckily, it turned out to be much, much easier than it had to be. All I had to do was be stuck at work for a while waiting for another team to do something before I can begin my work. This gave me some "free time."

Looking in the index.php file, it would appear the 404 is built in. So I copied just the top part of the file, and the bottom footer call. I added my own little flair in the middle, and here is my result:

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

<h1><?php _e('Not Found','atahualpa'); ?></h1>
<p><?php _e("Well that's embarrassing! I can't seem to find that!","atahualpa"); ?></p>
<p><?php _e("You could try one of two things. You can either:","atahualpa"); ?></p>
<h4><?php _e("Search","atahualpa"); ?></h4>
<p><?php get_search_form$echo ); ?></p>
<h4><?php _e("OR","atahualpa"); ?></h4>
<p><?php _e("You could try the old site, <a href='link-to-old-site'>link-to-old-site</a>.","atahualpa"); ?></p>

<?php get_footer(); ?>

I saved that as 404.php, and bingo! Everything works as expected.

Now I will use the same template to create a custom author.php file.


All times are GMT -6. The time now is 02:29 AM.

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