This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Customizing 404 page

  • Creator
    Topic
  • #5751
    mattvd
    Member

    Hi there, how can we customize the 404 page so it has a few links that link to other pages so the user can find other links to main pages in our website?

    Thansk

Viewing 15 replies - 1 through 15 (of 16 total)
  • Author
    Replies
  • #5753
    Jason Bobich
    Keymaster

    Hello,

    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.

    http://dev.themeblvd.com/tutorial/editable-content-files/

    #5755
    mattvd
    Member

    do I also have to copy and past 404 to my child theme too?

    #5769
    Jason Bobich
    Keymaster

    Just content-404.php unless you need to edit outside of the main content area. Experiment a little. Give it a whirl.

    #5813
    mattvd
    Member

    Hi 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

    #5827
    Jason Bobich
    Keymaster

    Yeah, 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.

    http://wordpress.org/extend/plugins/theme-blvd-string-swap/

    #5832
    mattvd
    Member

    hmm 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/asdf

    perhaps I should use the module you linked instead?

    #5834
    Jason Bobich
    Keymaster

    You’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) -->
    #7085
    Kjetil
    Participant

    Hi
    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,
    Kjetil

    Please 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?

    #7088
    Jason 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.

    #7094
    Kjetil
    Participant

    Thanks 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.
    Kj

    #7095
    Jason Bobich
    Keymaster

    Aw, 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.

    #7124
    Kjetil
    Participant

    Thanks 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,
    Kj

    #7134
    Jason Bobich
    Keymaster

    Aw, 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.

    #7183
    Kjetil
    Participant

    Now, 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,
    Kj

    #7185
    Jason Bobich
    Keymaster

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

Viewing 15 replies - 1 through 15 (of 16 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.