I have set up a 404 error response for the ‘uncategorised’ default wp category archive page using the redirection plugin. This redirects to a (presumably) wordpress default 404 page and not the error page template that is set up in bricks.
I got a response in my post. I hope they look into this more. I did look into the code a bit and the Bricks 404.php file does get called but for some reason it doesn’t find the custom error template for some reason and it defaults to the simple default one they created (with the Whoops message)
No not yet. In my other post on the topic I showed Bricks where in their code it was failing to detect the 404 template but no response from them if a fix is in the works.
function redirect_uncategorized_posts() {
if (is_single() && in_category('uncategorized')) {
wp_redirect(home_url('/404')); // Redirect to the 404
exit();
}
}
add_action('template_redirect', 'redirect_uncategorized_posts');
Your solution will not work as the problem actually starts in the Bricks 404 page file. It looks for a template file and doesn’t find one and displays just a default whoops message.
There is a bug in certain situations as the template array Bricks checks for an error file has not been updated yet.
Can confirm after creating and designing an Error 404 template and assigning it Template Settings > Conditions > (show on) Error page, Bricks only shows the default template containing: “Whoops, that page is gone” and a search box. Switching off Bricks > Settings > Templates> Disable default templates has no change in effect.
This does appear to be a bug. I have it working on one site and not another using the same conditions. So I am assuming an update has knocked something out of whack here. The 404 page should display when the condition of the template is set to error page (show). But it isn’t.
Same thing here. Oddly enough 404 was working just fine until recent update for me, but now just shows the “Whoops” page with search bar. I’ve submitted a bug report.
I’m facing the issue, one year later. Doesn’t seem to be fixed @timmse. This is a massive bug that means we can’t send people to 404 using PHP, which is quite a usual thing.
Works on every other theme I tested it with.
I used a more complex code snippet in the video, but it’s the same if I try to send a normal permalink to 404. I also didn’t use a child theme, as this is for demonstration only. It’s from wetransfer, so it won’t be up for long: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free.
You get the same error page if you set your site not to index (in the WordPress settings) and open /wp-sitemap.xml.