Customizing 404 page
-
AuthorReplies
-
February 22, 2013 at 11:44 pm #5753
Jason Bobich
KeymasterHello,
You can customize the content of the 404 page by copying content-404.php of the theme to your Child theme and adding in your custom content there.
February 23, 2013 at 12:13 am #5755mattvd
Memberdo I also have to copy and past 404 to my child theme too?
February 23, 2013 at 9:32 pm #5769Jason Bobich
KeymasterJust content-404.php unless you need to edit outside of the main content area. Experiment a little. Give it a whirl.
February 24, 2013 at 6:07 pm #5813mattvd
MemberHi there,
thanks for your help bbut please forgive me because I have no understanding of php whatsoever. here is a look at my content-404 document
http://i50.tinypic.com/vno2s3.jpg
How do I change that to just after that text have a link back to our home page? Do I just replace the 404 with the text I want in it?
Thanks
February 24, 2013 at 11:06 pm #5827Jason Bobich
KeymasterYeah, just take this part:
<?php echo themeblvd_get_local( '404' ); ?>
… And then you can remove it, if you want, and just put in whatever static HTML content you want in its place.
And also now seeing what you’re trying to do, I believe you should be able to accomplish this same task by using the Theme Blvd String Swap plugin without having to make any code customizations, if you want to try that, as well.
February 24, 2013 at 11:51 pm #5832mattvd
Memberhmm I changed the content-404 page and put into my child theme and heres the code on the content 404 page:
<?php /** * The template used for displaying content in 404.php */ ?> <div class="article-wrap"> <article> <div class="entry-content"> <h1><?php echo themeblvd_get_local( '404_title' ); ?></h1> <?php echo themeblvd_get_local( 'Oops! The page that you requested cannot be found. Please try again or go back <a href="http://uglyopportunities.com">home</a>' ); ?> </div><!-- .entry-content --> </article> </div><!-- .article-wrap (end) -->
and it outputs nothing.
http://uglyopportunities.com/asdfperhaps I should use the module you linked instead?
February 25, 2013 at 12:05 am #5834Jason Bobich
KeymasterYou’re thinking too hard. This is all you need to do. 😉
<?php /** * The template used for displaying content in 404.php */ ?> <div class="article-wrap"> <article> <div class="entry-content"> <h1><?php echo themeblvd_get_local( '404_title' ); ?></h1> Oops! The page that you requested cannot be found. Please try again or go back <a href="http://uglyopportunities.com">home</a>. </div><!-- .entry-content --> </article> </div><!-- .article-wrap (end) -->
April 1, 2013 at 10:50 am #7085Kjetil
ParticipantHi
This would be very useful – if I could make it work.
I have just pasted the code below into a 404-content.php file placed in my themes/alyeska-child folder.
It should be exactly the same setup as you gave mattvd above. But no custom 404 page shows up, like here: http://www.dolcevita.no/abcde
Could you please point out where I’m wrong?
Thanks,
KjetilPlease see http://pastie.org/7266945
PS
I tried to save a reply the normal way but got an
ERROR: Are you sure you wanted to do that?April 1, 2013 at 3:44 pm #7088Jason Bobich
Keymaster@Kjetil
This would be very useful – if I could make it work.
I have just pasted the code below into a 404-content.php file placed in my themes/alyeska-child folder.The name of your file should be content-404.php.
April 1, 2013 at 5:49 pm #7094Kjetil
ParticipantThanks for your quick reply
I’m sorry – the file name I have used IS “content-404.php”. I just mistyped it in the forum post above.
KjApril 1, 2013 at 6:36 pm #7095Jason Bobich
KeymasterAw, I see why you’re confused on this one. The issue is not with the theme or how you’re setting up your content-404.php, but just with how you’ve configured WordPress.
You haven’t setup any permalinks and so WordPress 404 handling isn’t going to work outside of the root directory where WordPress is running. You can see your 404 template, in terms of the theme, is working correctly:
http://www.dolcevita.no/?p=555555
And so after you go to Settings > Permalinks, and setup your permalinks correctly on your server by allowing WordPress to place the proper code in a writeable .htaccess file, you should also notice that this effects 404 handling with the permalinks, as well.
April 3, 2013 at 8:00 am #7124Kjetil
ParticipantThanks once again for clearing things up.
I think I’ll have to leave this possibility. As you probably remember, I had those problems with the permalinks – the problem you helped me with here… If I start messing with the permalinks again I’m afraid I’m back to start.
Thanks,
KjApril 3, 2013 at 7:39 pm #7134Jason Bobich
KeymasterAw, yeah that’s right. I’d really look into that further, if it involves changing hosts or whatever. Not having permalinks is a huge deal with your website. That really needs to be working properly. Having your entire website cached in Google without permalinks is going to be horrible for SEO. Also, it’s going to be tough to ever give out links to pages of your site as it gets promoted or whatever, online or otherwise.
April 4, 2013 at 6:20 pm #7183Kjetil
ParticipantNow, THAT is useful info! – about the importance of permalinks.
I figured “default” permalinks are also permalinks, though they’re not “pretty” (like http://site/?p=10254)Since our host don’t seem to take this seriously, and since I’ve had similar problems with two other (out of 10) sites there, changing host seems worth the effort.
As a final try, though:
Is there any of the permalink setups that are more likely to work/ more server friendly than the one we used previously (http://www.dolcevita.no/postname/ – and before that, in case it matters: http://www.dolcevita.no/category/postname/)?Thanks for your time,
KjApril 4, 2013 at 6:27 pm #7185Jason Bobich
KeymasterFor me personally, I’ve found that you’ll have the least problems if you select one of the WordPress default settings. I always use the “Day and name” and setting because I feel comfortable knowing that there’s realistically never going to be any conflict in one page or another. I’ve seen a lot of people that use the custom structure setting and that run into weird problems when URL’s sometimes conflict.
-
AuthorReplies
- The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.