I have set a 404 Error page w/ correct template conditions set to show on ‘Error Page’ however the page does not load when visiting a URL that doesn’t exist. In it’s place is the default “Whoops” page with a search bar.
Hi guys,
Sorry for the late reply, and thanks so much for your reports!
Unfortunately, I cannot reproduce the issue. Would any of you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?
If anyone else can share their site access for @timmse to replicate the issue please do so, as I installed ‘WP 301 Redirect’ to help with the issue post-404 not working which makes it hard to pin-point errors.
This is not a complete fix (at least it is not working in Bricks 1.9.3). The code snippet below that uses
add_action( 'template_redirect', ...
will not use the Bricks 404 template but just shows the default one with the “Whoops, that page is gone” message.
This issue has been discussed in most of the other topics about 404 issues.
// For example: https://domain.com/category/uncategorized/
// If not using Category Taxonomy deleting of Uncategorized Category not possible
function ess_disable_uncategorized_category_archives() {
// if we are on Uncategorized category archive page
if (is_category('uncategorized')) {
global $wp_query;
$wp_query->set_404();
status_header(404);
}
}
// Disable access
add_action( 'template_redirect', 'ess_disable_uncategorized_category_archives' );
The 404 status code is returned but neither the default 404 page or my custom 404 template is returned. Instead the homepage is returned (with a 404 status code) and anything that is queried is empty.