Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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

Custom 404 page


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 6, 2009, 04:33 PM
paulae's Avatar
paulae
 
1,330 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Flynn, I apologize in advance for yet another question! I think I'm so inspired by Atahualpa that I can't stop thinking of ways to enhance the website by using it.

I've been reading about improving the user experience by presenting a better 404-File Not Found page. The Codex has a lot about it, and I even found a plugin (Useful 404's) that would help create a better page. But Atahualpa doesn't seem to have a 404.php to edit. I notice that index.php has the "Sorry, what you're looking for isn't here" near the footer. I was able to change that to something a bit nicer, but I didn't hack around any further.

Can we create a 404 page and have it intercept the lost user, and can we customize it via the plugin or by just pasting in some code we find elsewhere, like alistapart.com? And do we need to point to it via the .htaccess file?
  #2  
Old Apr 6, 2009, 05:58 PM
Flynn's Avatar
Flynn
 
3,754 posts · Oct 2008
Munich, Germany
You can copy index.php as 404.php but it needs to have the upper part of index.php up to <?php get_header(); ?> and the <?php get_footer(); ?> at the bottom

Whenever a Wordpress page (any type) is being requested Wordpress first looks for a specific template for the given page type, then for a less specific template, and finally falls back to index.php. In Atahualpa's default state it always falls back to index.php because there's no page.php, 404.php etc.

Here's the Wordpress page template hierarchy, which is also a list of page templates you can create by copying and editing index.php

http://codex.wordpress.org/File:Template_Hierarchy.png
  #3  
Old Apr 11, 2009, 01:12 PM
seneque
 
12 posts · Mar 2009
hello

I am glad to have found this post on the forum (by the way the search function of the forum did not found "404" Keyword).
I have the same question of setting a specific 404 page

I do not understand what you mean by
Quote:
You can copy index.php as 404.php but it needs to have the upper part of index.php up to <?php get_header(); ?> and the <?php get_footer(); ?> at the bottom
could you please help a bit more to set up a 404.php file ?

thanks

seneque
  #4  
Old Apr 11, 2009, 01:25 PM
seneque
 
12 posts · Mar 2009
I have solved my problem by modifying index.php.
In fact there is no need for a specific 404 page
I have added a sitemap and the google script

seneque
  #5  
Old Apr 11, 2009, 10:26 PM
Flynn's Avatar
Flynn
 
3,754 posts · Oct 2008
Munich, Germany
Yes, you can either put everything into index.php (that's how Atahualpa does it) or make a copy of index.php and save that as "404.php" and upload it. Wordpress will automatically use that 404.php file if a page was not found.

Having many different files (index.php, page.php, home.php, category.php, 404.php, author.php......) is a more static and traditional approach but has the benefit that it requires less PHP code such as

if ( is_page() ) { do this } and if ( is_category() ) { do that }

The downside is more redundancy as most of these files will probably be identical to some extent, and edits will often have to be repeated in each file.

The downside to the all-in-one index.php approach of Atahualpa is that most tutorials on the web are geared towards the traditional approach and users are wondering "where is page.php ?"
  #6  
Old Apr 5, 2010, 04:01 PM
X-Evolutionist's Avatar
X-Evolutionist
 
41 posts · Mar 2010
Californian living in Oklahoma City
Can you use html for <a> tags in your Not Found part of the Style Center area of the index.php? I tried it and I got an error message. I'd like add a few helpful links in this area:

Content if NOT FOUNDAdd/edit/remove the content here that is displayed on "404 Not Found" pages.

Can you give a head start of the format for adding more html than just <p> tags. I know html, but I mean to add it into this line:

<h2><?php _e('Not Found','atahualpa'); ?></h2> <p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>

I do not want to try to make a custom 404 if I can do it in the index.php.

Thank you,

X
__________________
Reasons Why I Believe in God:
http://x-evolutionist.com/

Last edited by X-Evolutionist; Apr 5, 2010 at 04:12 PM.
  #7  
Old May 4, 2011, 04:13 PM
mimi's Avatar
mimi
 
70 posts · Feb 2009
over there...
Hi there, yes please, as X said, can we have some examples? Thanks
  #8  
Old May 4, 2011, 04:42 PM
juggledad's Avatar
juggledad
 
21,937 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
you can use links in the ato->Style & edit CENTER COLUMN->Content if NOT FOUND

HTML Code:
<h2><?php _e('Not Found','atahualpa'); ?></h2>
<p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>For help, just click<a href="http://yourdomain.com/">here</a>
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #9  
Old May 4, 2011, 05:12 PM
mimi's Avatar
mimi
 
70 posts · Feb 2009
over there...
Thank you, this is useful. Do you know if it's possible to have a site map there, is it easy to insert?
  #10  
Old May 4, 2011, 05:24 PM
mimi's Avatar
mimi
 
70 posts · Feb 2009
over there...
PS, any reason to use PHP then?

For instance,
Quote:
<p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>
can be simply:
Quote:
Sorry, but you are looking for something that isn't here.
What is the difference?
  #11  
Old May 4, 2011, 05:28 PM
lmilesw's Avatar
lmilesw
 
10,046 posts · Jul 2009
Central New York State USA
Try them both and see what happens.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #12  
Old May 4, 2011, 05:32 PM
mimi's Avatar
mimi
 
70 posts · Feb 2009
over there...
Both work. Is it not supposed to?
  #13  
Old May 4, 2011, 06:28 PM
lmilesw's Avatar
lmilesw
 
10,046 posts · Jul 2009
Central New York State USA
They will both work to give you some text. Here is more of an explanation of what the code is for.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #14  
Old May 5, 2011, 08:12 AM
mimi's Avatar
mimi
 
70 posts · Feb 2009
over there...
Thank you, it's quite technical :P
  #15  
Old Jul 4, 2011, 04:16 PM
cway
 
154 posts · Jul 2009
Under ATA > Style and Edit Center Column I don't see the Content if not found option. Has it moved in Atahualpa 3.6.7 ?
  #16  
Old Jul 5, 2011, 04:42 AM
juggledad's Avatar
juggledad
 
21,937 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
PHP code isn't allowed anymore in the Atahualpa Theme Options. Atahualpa was one of few themes, if not the only theme, to allow custom PHP code to be inserted through theme options.

WordPress's philosophy as to what themes should or should not be able to do (i.e. which PHP functions they can use) has been tightened up quite a bit lately, so in order to stay listed on wordpress.org we had to remove this 'custom PHP' feature

You will now have to edit index.php and make the changes there, see lines 53-54
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom 404: Dunstan-style Error Page Plugin twincascos Plugins & Atahualpa 3 Dec 20, 2010 08:26 AM
[SOLVED] Permalink or 404 error - page not displaying correctly woolef Atahualpa 3 Wordpress theme 19 Apr 4, 2010 02:08 PM
How to customize 404 error page? wfzimmerman Atahualpa 3 Wordpress theme 16 Mar 7, 2010 07:11 AM
How to add custom page menu bar rinoa3108 Page & Category Menu Bars 2 May 5, 2009 04:33 PM


All times are GMT -6. The time now is 05:22 AM.


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