Community Forums › Forums › Archived Forums › General Discussion › Problem adding custom 404 page
- This topic has 7 replies, 3 voices, and was last updated 10 years, 6 months ago by
Porter.
-
AuthorPosts
-
August 15, 2014 at 5:23 am #118956
uwitness
MemberI've been trying to add a custom 404 page to a site I've built at http://louisbarabbas.com, as the default with a complete sitemap is rather overkill in this case. However, no matter what I try, the default Genesis 404 page refuses to be replaced. I'm using the Dynamik Website Builder child theme.
Methods I've tried:
1. I’ve uploaded a 404.php containing code for a much simpler 404 page (sourced from here), but nothing happened. I turned off all plugins to see if there might be a conflict there, but still no change.
2. I’ve tried plugins too - Bill Erickson's Genesis 404 page plugin did nothing. David Decker's Genesis Widgetized Not Found & 404 plugin managed to add widgets to the Genesis default 404, but that wasn't really what I was after.
3. I’ve also tried adding code code to my functions.php to redirect a 404 not found to any URL on my site, and point it to a standard WordPress page I'd created. Again, no change.
4. Although I realise we're not supposed to edit the core Genesis 404.php, in a final attempt to see if anything could be changed, I went in and edited a couple of words of the default introduction. Even that showed no change.
Anyone have any ideas why it's proving impossible to replace the default Genesis 404 page in any way whatsoever? Completely stumped here. Thanks!
http://louisbarabbas.comAugust 15, 2014 at 9:24 am #119008Ben @ Inbound Creative
MemberYou mean this page?
That's what came up when I put in the ubiqutous 404 test of http://www.sitename.com/404.
There's a chance it's because the Genesis 404 page is cached on your computer. Try it from a mobile or tablet to test if that's the case.
August 15, 2014 at 9:32 am #119012uwitness
MemberAh, sorry Ben - that was my mistake (though thanks very much for your answer!). That page is left up from my attempt (as stated in item 3 in my original post) to add code to my functions.php to redirect to a static page I'd created to carry a 404 message. I've set that back to draft now.
So I'm talking about, for instance, http://louisbarabbas.com/pagetitle
Yeah, I wondered if it was a particularly stubborn cache, but I've tried it on different browsers, on tablet and on mobile now, and tried clearing the cache, turning off the cache, turning off my CDN, everything, and still the same default Genesis 404 page, sadly.
August 15, 2014 at 10:34 am #119017Porter
ParticipantHere's what I'm using:
add_action( 'template_redirect', 'redirect_404_to_any_url' ); /** * @author Brad Dalton * @example http://wpsites.net/wordpress-tips/redirect-404-page-not-found-to-any-url/ * @copyright 2014 WP Sites */ function redirect_404_to_any_url() { if ( is_404() ) : wp_redirect( 'http://yoursite.com/the-page', 301 ); exit; endif; }
That'll let you specify the url to redirect to when getting a 404, and you can build that page as you please.
August 15, 2014 at 1:31 pm #119036uwitness
MemberThanks Porter. Unfortunately I'd already tried that one with no success (see no.3 in my original post). Just tried it again, just in case, and still no good, but cheers for the suggestion.
August 15, 2014 at 1:32 pm #119039Porter
ParticipantAh, missed that. I can't possibly imagine why that would happen - do you have a custom 404.php file in your directory? Perhaps that's messing it up? If not, it's definitely a plugin conflict, or something specific to your Dynamic theme.
August 15, 2014 at 1:47 pm #119052uwitness
MemberI've had a custom 404.php file in my child theme directory previously, yes, when I was trying the recommended route of using a custom 404 to override the default Genesis version, but when I'd tried the redirect to any URL instruction in functions.php, I'd deliberately removed the file just to be sure.
August 15, 2014 at 2:05 pm #119072Porter
ParticipantThat's what I was curious about.
Given that information, all I can suggest is disabling your plugins. If that doesn't work, I'd ask for help from those who know the Dynamic theme. I've never used it, but I believe that's the one where you can easily make any design, from the dashboard? If so, I would assume they've done a lot of tweaking, which is causing our lack of understanding for this scenario.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.