Skip to content

Commit

Permalink
Fix the paged home page handler 404 response (#459)
Browse files Browse the repository at this point in the history
Load the block theme 404 template
  • Loading branch information
adamwoodnz authored Jan 2, 2024
1 parent c663ca0 commit 708401f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/wp-content/themes/wporg-developer-2023/inc/redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,17 @@ public static function redirect_pluralized_reference_post_types() {
public static function paginated_home_page_404() {
// Paginated front page.
if ( is_front_page() && is_paged() ) {
include( get_template_directory() . '/404.php' );
// Add the usual 404 page body class so that styles are applied.
add_filter(
'body_class',
function( $classes ) {
$classes[] = 'error404';

return $classes;
}
);

include( get_404_template() );
exit;
}
}
Expand Down

0 comments on commit 708401f

Please sign in to comment.